#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, cnt = 0, ct = 0, c = 0;
  cin >> n;
  long long arr[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 1)
      cnt++;
    else if (arr[i] == 2)
      ct++;
    else if (arr[i] == 3)
      c++;
  }
  int ar[3];
  ar[0] = cnt;
  ar[1] = ct;
  ar[2] = c;
  sort(ar, ar + 3);
  cout << n - ar[2] << endl;
  return 0;
}
