#include <bits/stdc++.h>
using namespace std;
int n, t;
int a[4];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  t = max(t, max(a[3], max(a[1], a[2])));
  cout << n - t << endl;
  return 0;
}
