#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> arr;
  int p = 0, q = 0, r = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) p++;
    if (a[i] == 2) q++;
    if (a[i] == 3) r++;
  }
  arr.push_back(p);
  arr.push_back(q);
  arr.push_back(r);
  sort(arr.begin(), arr.end());
  cout << arr[0] + arr[1];
}
