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