#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt[3] = {};
  while (n--) {
    int val;
    cin >> val;
    cnt[val - 1]++;
  }
  cout << min(cnt[0] + cnt[1], min(cnt[0] + cnt[2], cnt[1] + cnt[2])) << endl;
  return 0;
}
