#include <bits/stdc++.h>
using namespace std;
int n, *a;
int main() {
  int n1 = 0, n2 = 0, n3 = 0;
  cin >> n;
  a = (int*)malloc(n * sizeof(int));
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      n1++;
    else if (a[i] == 2)
      n2++;
    else
      n3++;
  }
  cout << n - max(max(n1, n2), n3);
  return 0;
}
