#include <bits/stdc++.h>
using namespace std;
int ar1[1000][1000], ar2[10000000];
int re1 = 0, re2 = 0;
int test = 0;
int main() {
  int a = 0, b = 0, c = 0, d = 0, result = 0;
  scanf("%d", &a);
  for (int i = 1; i <= a; i++) {
    scanf("%d", &result);
    if (result == 1) {
      b++;
    } else if (result == 2) {
      c++;
    } else {
      d++;
    }
  }
  result = max(b, c);
  result = max(result, d);
  result = b + c + d - result;
  printf("%d", result);
}
