#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp, one = 0, two = 0, three = 0, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (tmp == 1) one++;
    if (tmp == 2) two++;
    if (tmp == 3) three++;
  }
  m = max(one, max(two, three));
  cout << n - m;
  return 0;
}
