#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int a[4];
  memset(a, 0, sizeof(a));
  int x;
  int cnt = n;
  while (cnt--) {
    cin >> x;
    a[x]++;
  }
  int ans = max(a[1], max(a[2], a[3]));
  ans = n - ans;
  cout << ans << endl;
  return 0;
}
