#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  int a[n];
  long long int c1 = 0, c2 = 0, c3 = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      c1++;
    else if (a[i] == 2)
      c2++;
    else
      c3++;
  }
  cout << (c1 + c2 + c3) - max(c3, (max(c1, c2))) << endl;
}
