#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int num[3];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) num[a[i] - 1]++;
  int ans = n;
  for (int i = 0; i < 3; ++i) {
    ans = min(ans, num[i] + num[(i + 1) % 3]);
  }
  cout << ans << endl;
  return 0;
}
