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