#include <bits/stdc++.h>
using namespace std;
int maax(vector<int> w) {
  int temp = -1;
  for (int k = 0; k < w.size(); k++) {
    if (w[k] > temp) {
      temp = w[k];
    }
  }
  return temp;
}
int main() {
  bool b = false;
  bool n = false;
  vector<int> e(3);
  e[0] = 0;
  e[1] = 0;
  e[2] = 0;
  int x = 0;
  cin >> x;
  int j = 0;
  vector<int> a;
  for (int i = 0; i < x; i++) {
    cin >> j;
    a.push_back(j);
  }
  for (int o = 0; o < x; o++) {
    if (a[o] == 1) {
      e[0]++;
    }
    if (a[o] == 2) {
      e[1]++;
    }
    if (a[o] == 3) {
      e[2]++;
    }
  }
  int d = 0;
  int z = maax(e);
  if (z == e[0]) {
    d = e[2] + e[1];
    cout << d << endl;
    b = true;
  }
  if (z == e[1] && b == false) {
    d = e[0];
    d += e[2];
    cout << d << endl;
    n = true;
  }
  if (z == e[2] && b == false && n == false) {
    d = e[1] + e[0];
    cout << d << endl;
  }
  return 0;
}
