#include <bits/stdc++.h>
int main() {
  int a[1000002], i, p = 0, q = 0, r, max, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = 0; i < n; i++) {
    if (a[i] == 1)
      p++;
    else if (a[i] == 2)
      q++;
  }
  r = n - (p + q);
  max = p > q && p > r ? p : q > r ? q : r;
  printf("\n%d", n - max);
  return (0);
}
