#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt1 = 0, cnt2 = 0, cnt3 = 0;
  cin >> n;
  int s[n], i;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == 1) ++cnt1;
    if (s[i] == 2) ++cnt2;
    if (s[i] == 3) ++cnt3;
  }
  int temp0, temp;
  temp0 = max(cnt1, cnt2);
  temp = max(temp0, cnt3);
  cout << (cnt1 + cnt2 + cnt3) - temp << endl;
  return 0;
}
