#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ones = 0, twos = 0, threes = 0;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    if (temp == 1)
      ones++;
    else if (temp == 2)
      twos++;
    else
      threes++;
  }
  int mx = max(ones, max(twos, threes));
  cout << n - mx << endl;
}
