#include <bits/stdc++.h>
using namespace std;
int main() {
  int size, c, i, count1 = 0, count2 = 0, count3 = 0;
  scanf("%d", &size);
  for (i = 0; i < size; i++) {
    scanf("%d", &c);
    if (c == 1)
      count1++;
    else if (c == 2)
      count2++;
    else if (c == 3)
      count3++;
  }
  printf("%d", size - max(max(count1, count2), max(count2, count3)));
}
