#include <bits/stdc++.h>
using namespace std;
vector<char> counter;
int main() {
  long n, i = 0, count1, count2, count3;
  char c;
  cin >> n;
  while (i < n) {
    cin >> c;
    if (isdigit(c)) {
      i++;
      counter.push_back(c);
    }
  }
  count1 = n - count(counter.begin(), counter.end(), '1');
  count2 = n - count(counter.begin(), counter.end(), '2');
  count3 = n - count(counter.begin(), counter.end(), '3');
  cout << int(fmin(fmin(count1, count2), count3)) << endl;
  return 0;
}
