#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = 0;
  int b = 0;
  int c = 0;
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    if (m == 1) {
      a++;
    }
    if (m == 2) {
      b++;
    }
    if (m == 3) {
      c++;
    }
  }
  int max = a;
  if (b > max) {
    max = b;
  }
  if (c > max) {
    max = c;
  }
  cout << n - max << endl;
}
