#include <bits/stdc++.h>
using namespace std;
int a[1000005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int b[5] = {0, 0, 0, 0, 0};
  for (int i = 0; i < n; i++) {
    if (a[i] == 1)
      b[1]++;
    else if (a[i] == 2)
      b[2]++;
    else if (a[i] == 3)
      b[3]++;
  }
  sort(b, b + 4);
  reverse(b, b + 4);
  cout << n - b[0];
  return 0;
}
