#include <bits/stdc++.h>
using namespace std;
signed main() {
  cout.tie(0), cin.tie(0), ios::sync_with_stdio(0);
  long long n, temp;
  cin >> n;
  long long cnt1 = 0, cnt2 = 0, cnt3 = 0;
  for (long long i = 0; i < n; i++) {
    cin >> temp;
    if (temp == 1)
      cnt1++;
    else if (temp == 2)
      cnt2++;
    else
      cnt3++;
  }
  cout << n - max(max(cnt1, cnt2), cnt3);
  return 0;
}
