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