#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, one = 0, two = 0, three = 0;
  scanf("%lld", &n);
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    if (a == 1) {
      one++;
    } else if (a == 2) {
      two++;
    } else {
      three++;
    }
  }
  int a = one + two;
  int b = two + three;
  int c = one + three;
  int cnt = min(a, b);
  cnt = min(cnt, c);
  printf("%d", cnt);
  return 0;
}
