#include <bits/stdc++.h>
using namespace std;
long n, x, a, b, c;
int main() {
  scanf("%ld", &n);
  a = b = c = 0;
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &x);
    if (x == 1)
      a++;
    else if (x == 2)
      b++;
    else
      c++;
  }
  printf("%ld", n - max(c, max(a, b)));
  return 0;
}
