#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<ll> A(n);
  for (auto& _a : A) cin >> _a;
  int cnt[4] = {};
  for (int x : A) ++cnt[x];
  ll ans = max({cnt[1], cnt[2], cnt[3]});
  n -= ans;
  cout << n << '\n';
}
