#include <bits/stdc++.h>
using namespace std;
int dirx[] = {1, -1, 0, 0};
int diry[] = {0, 0, 1, -1};
struct point {
  int x;
  int y;
};
bool cmp(int a, int b) { return a > b; }
bool cmp1(pair<long long, long long> a, pair<long long, long long> b) {
  return abs(a.first - a.second) > abs(b.first - b.second);
}
bool isprime(long long n) {
  if (!(n & 1)) return 0;
  if (n < 2) return 0;
  long long sq = sqrt(n);
  for (int long long i = 3; i <= sq; i += 2) {
    if (n % i == 0) return 0;
  }
  return 1;
}
void solve() {
  int n;
  cin >> n;
  int one = 0, two = 0, three = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x == 1)
      one++;
    else if (x == 2)
      two++;
    else
      three++;
  }
  int mx = max({one, two, three});
  cout << n - mx;
}
int main() { solve(); }
