#include <bits/stdc++.h>
using namespace std;
int one, two, three;
int main() {
  int n, i, j, k, a, b;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a == 1)
      one++;
    else if (a == 2)
      two++;
    else
      three++;
  }
  if (one && !two && !three)
    printf("0");
  else if (two && !one && !three)
    printf("0");
  else if (three && !two && !one)
    printf("0");
  else if ((one && two && !three) || (one && three && !two) ||
           (two && three && !one)) {
    if (!one)
      b = min(two, three);
    else if (!two)
      b = min(one, three);
    else
      b = min(one, two);
    printf("%d\n", b);
  } else {
    b = min(one + two, one + three);
    b = min(b, two + three);
    cout << b << endl;
  }
  return 0;
}
