#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int LCM(int a, int b) { return (a * b) / gcd(a, b); }
long long fast_exp(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1)
      res = ((res % 1000000007) * (base % 1000000007)) % 1000000007;
    base = ((base % 1000000007) * (base % 1000000007)) % 1000000007;
    exp /= 2;
  }
  return res % 1000000007;
}
void print_interator(set<int>& a) {
  for (auto it = a.begin(); it != a.end(); it++) {
    cout << *it << " ";
  }
}
int sum_vec(vector<int>& a) {
  int s = 0;
  for (int i = 0; i < a.size(); i++) {
    s += a[i];
  }
  return s;
}
int maximum(vector<int>& a) {
  int ans = a[0];
  for (int i = 1; i < a.size(); i++) {
    ans = max(ans, a[i]);
  }
  return ans;
}
int minimum(vector<int>& a) {
  int ans = a[0];
  for (int i = 1; i < a.size(); i++) {
    ans = min(ans, a[i]);
  }
  return ans;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int c1 = 0, c2 = 0, c3 = 0;
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      c1++;
    else if (a[i] == 2)
      c2++;
    else if (a[i] == 3)
      c3++;
  }
  if (c1 >= c2 && c1 >= c3)
    cout << (n - c1);
  else if (c2 >= c1 && c2 >= c3)
    cout << (n - c2);
  else
    cout << (n - c3);
  return 0;
}
