#include <bits/stdc++.h>
using namespace std;
const int inf = 100000000;
const double eps = 0.000001;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), res(3, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    res[a[i] - 1]++;
  }
  cout << res[0] + res[1] + res[2] - max(res[0], max(res[1], res[2]));
  return 0;
}
