#include <bits/stdc++.h>
using namespace std;
int main() {
  int count1 = 0, count2 = 0, count3 = 0;
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int t;
    cin >> t;
    if (t == 1) count1++;
    if (t == 2) count2++;
    if (t == 3) count3++;
  }
  int ans = count1 + count2 + count3 - max(count1, max(count2, count3));
  printf("%d\n", ans);
}
