#include <bits/stdc++.h>
using namespace std;
int length(int k) {
  int c = 0;
  while (k) {
    k /= 10;
    c++;
  }
  return c;
}
int bigmod(string s, int k) {
  int i, rem = 0;
  for (i = 0; i < s.size(); i++) {
    rem = (rem * 10 + s[i] - '0') % k;
  }
  return rem;
}
void bigdiv(string s, int k) {
  char q[20];
  int i, r = 0, j = 0, d = 0, x;
  string a;
  for (i = 0; i < s.size(); i++) {
    d = r * 10 + s[i] - '0';
    x = d / k;
    if (!(j == 0 && x == 0)) {
      q[j] = x + 48;
      j++;
    }
    r = d % k;
  }
  if (j == 0)
    cout << '0';
  else
    for (i = 0; i < j; i++) cout << q[i];
}
int main() {
  int maxx = 0, n, i;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int b[4] = {0};
  for (i = 0; i < n; i++) {
    b[a[i]]++;
    maxx = max(maxx, b[a[i]]);
  }
  cout << n - maxx;
}
