#include <bits/stdc++.h>
using namespace std;
int hasil(int a, int b) { return a > b ? a : b; }
int main() {
  int input, angka, jml1, jml2, jml3, c;
  jml1 = jml2 = jml3 = 0;
  cin >> input;
  int sama = input;
  while (sama > 0) {
    sama--;
    cin >> angka;
    if (angka == 1)
      jml1++;
    else if (angka == 2)
      jml2++;
    else
      jml3++;
  }
  c = input - hasil(hasil(jml1, jml2), jml3);
  cout << c << endl;
  return 0;
}
