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