#include <bits/stdc++.h>
using std::max;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + c - '0';
  return x * f;
}
long long t[5], n, x;
int main() {
  n = read();
  while (n--) {
    x = read();
    t[x]++;
  }
  x = max(t[1], max(t[2], t[3]));
  printf("%lld", t[1] + t[2] + t[3] - x);
  return 0;
}
