#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 1000 * 1000 + 47;
int C[3];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = (0); i < (n); i++) {
    int a;
    cin >> a;
    a--;
    C[a]++;
  }
  int ans = min(C[0] + C[1], min(C[1] + C[2], C[0] + C[2]));
  cout << ans << endl;
}
