#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n + 1];
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    if (arr[i] == 1)
      a++;
    else if (arr[i] == 2)
      b++;
    else
      c++;
  }
  int mx = max(c, max(a, b));
  cout << n - mx << endl;
  return 0;
}
