#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long count[] = {0, 0, 0, 0};
  long n;
  cin >> n;
  while (n--) {
    long x;
    cin >> x;
    count[x] += 1;
  }
  cout << min(min(count[1] + count[2], count[1] + count[3]),
              count[2] + count[3]);
  return 0;
}
