#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, i, l = 0, k = 0, j = 0, t = 0, p = 0, max = 0;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    k++;
    cin >> a[i];
    if (a[i] == 1) {
      l++;
    }
    if (a[i] == 2) {
      j++;
    }
    if (a[i] == 3) {
      t++;
    }
    if (l > j) {
      max = l;
    }
    if (j > max) {
      max = j;
    } else if (t > max) {
      max = t;
    }
  }
  cout << (n - max) << endl;
  return 0;
}
