#include <bits/stdc++.h>
using namespace std;
int n, a[1000001];
int cont1, cont2, cont3;
int s1, s2, s3;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1)
      cont1++;
    else if (a[i] == 2)
      cont2++;
    else
      cont3++;
  }
  s1 = cont1 + cont2;
  s2 = cont2 + cont3;
  s3 = cont1 + cont3;
  if (s1 <= s2 && s1 <= s3)
    cout << s1;
  else if (s2 <= s1 && s2 <= s3)
    cout << s2;
  else if (s3 <= s1 && s3 <= s2)
    cout << s3;
  else
    cout << "0";
  return 0;
}
