#include <bits/stdc++.h>
using namespace std;
int max(int a, int b, int c) {
  int x = c + b, y = a + c, z = a + b;
  if (x <= y && x <= z)
    cout << x << endl;
  else if (z <= y && x >= z)
    cout << z << endl;
  else if (x >= y && y <= z)
    cout << y << endl;
  return 0;
}
int main() {
  int n, a = 0, b = 0, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x == 1)
      a++;
    else if (x == 2)
      b++;
    else if (x == 3)
      c++;
  }
  max(a, b, c);
  return 0;
}
