#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
int primes[100000];
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int arr[n];
  int count1 = 0, count2 = 0, count3 = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 1) {
      count1++;
    }
    if (arr[i] == 2) {
      count2++;
    }
    if (arr[i] == 3) {
      count3++;
    }
  }
  int t1 = (count2 + count3);
  int t2 = (count1 + count3);
  int t3 = (count2 + count1);
  cout << min(t1, min(t2, t3)) << endl;
end:
  return 0;
}
