#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, a, b1 = 0, b2 = 0, b3 = 0;
  scanf("%d", &n);
  j = n;
  while (n--) {
    scanf("%d", &a);
    if (a == 1) b1++;
    if (a == 2) b2++;
    if (a == 3) b3++;
  }
  m = max(b1, b2);
  m = max(m, b3);
  printf("%d\n", j - m);
  return 0;
}
