#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p = 0, q = 0, v = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) {
      v++;
    } else if (a[i] == 2) {
      p++;
    } else {
      q++;
    }
  }
  int w = max(v, max(p, q));
  if (w == v) {
    cout << p + q << endl;
  } else if (w == p) {
    cout << v + q << endl;
  } else {
    cout << p + v << endl;
  }
  return 0;
}
