#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s1 = 0, s2 = 0, s3 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a == 1) s1++;
    if (a == 2) s2++;
    if (a == 3) s3++;
  }
  int k = max(max(s1, s2), s3);
  cout << n - k;
  return 0;
}
