#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tg, a = 0, b = 0, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tg;
    switch (tg) {
      case 1:
        a++;
        break;
      case 2:
        b++;
        break;
      case 3:
        c++;
        break;
    }
  }
  a = max(a, b);
  a = max(a, c);
  cout << n - a << endl;
  return 0;
}
