#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int a[MAXN], n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int mx = max(count(a, a + n, 1), max(count(a, a + n, 2), count(a, a + n, 3)));
  cout << n - mx;
}
