#include <bits/stdc++.h>
int main() {
  int a[1000001];
  int n, one = 0, two = 0, three = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1) one++;
    if (a[i] == 2) two++;
    if (a[i] == 3) three++;
  }
  if (one >= two && one >= three)
    printf("%d", two + three);
  else if (two >= one && two >= three)
    printf("%d", one + three);
  else if (three >= one && three >= two)
    printf("%d", one + two);
}
