#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n;
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < n; i++) {
    cin >> k;
    if (k == 1)
      a++;
    else if (k == 2)
      b++;
    else
      c++;
  }
  cout << min(n - a, min(n - b, n - c)) << endl;
  return 0;
}
