#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, o = 0, t = 0, th = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    switch (x) {
      case 1:
        o++;
        break;
      case 2:
        t++;
        break;
      case 3:
        th++;
    }
  }
  cout << (n - max(o, max(t, th))) << "\n";
}
