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