#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, cnt[5] = {};
  scanf("%d", &n);
  for (register int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    ++cnt[x];
  }
  printf("%d", n - max(cnt[1], max(cnt[2], cnt[3])));
  return 0;
}
