#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)(t.size()))); ++(i)) s << t[i] << " ";
  return s;
}
int main() {
  int(n);
  scanf("%d", &(n));
  int a[4] = {0, 0, 0, 0};
  for (int(i) = 0; (i) < (n); ++(i)) {
    int(x);
    scanf("%d", &(x));
    a[x]++;
  }
  pisz(min(a[1] + a[2], min(a[1] + a[3], a[2] + a[3])));
}
