#include <bits/stdc++.h>
using namespace std;
void show_vector(vector<int>& a) {
  for (vector<int>::iterator it = a.begin(); it != a.end(); ++it) cout << *it;
}
int main() {
  int n, v, a = 0, b = 0, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v;
    if (v == 1)
      a++;
    else if (v == 2)
      b++;
    else
      c++;
  }
  cout << n - max(max(a, b), c);
}
