#include <bits/stdc++.h>
int n;
int list[1000010];
int cnt[5];
int Max(int a, int b) { return a > b ? a : b; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &list[i]);
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  for (int i = 1; i <= n; ++i) cnt[list[i]] += 1;
  printf("%d\n", n - Max(cnt[1], Max(cnt[2], cnt[3])));
  return 0;
}
