#include <bits/stdc++.h>
using namespace std;
struct wnr {
  char val;
  char pos;
};
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int cnt1 = 0;
  long long int cnt2 = 0;
  long long int cnt3 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) {
      cnt1++;
    } else if (a[i] == 2) {
      cnt2++;
    } else if (a[i] == 3) {
      cnt3++;
    }
  }
  int b[3];
  b[0] = cnt1;
  b[1] = cnt2;
  b[2] = cnt3;
  sort(b, b + 3);
  cout << b[0] + b[1] << endl;
}
int main() {
  { solve(); }
}
