#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count1 = 0, count2 = 0, count3 = 0;
  cin >> n;
  int arr[n];
  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++;
    }
  }
  cout << n - max(count1, max(count2, count3));
  return 0;
}
