#include <bits/stdc++.h>
using namespace std;
int color[1001];
int main() {
  int n, p;
  while (cin >> n) {
    vector<int> vec;
    int one = 0;
    int two = 0;
    int three = 0;
    for (int i = 0; i < n; i++) {
      cin >> p;
      if (p == 1) one++;
      if (p == 2) two++;
      if (p == 3) three++;
    }
    vec.push_back(one);
    vec.push_back(two);
    vec.push_back(three);
    sort(vec.begin(), vec.end());
    cout << vec[0] + vec[1] << endl;
  }
  return 0;
}
