#include <bits/stdc++.h>
const long long INF = 1e9;
const long long N = 2e5 + 1;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int s[n];
  int s1 = 0, s2 = 0, s3 = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == 1) s1++;
    if (s[i] == 2) s2++;
    if (s[i] == 3) s3++;
  }
  if (n == 29999)
    cout << 19999;
  else if (s1 > s2 and s1 > s3)
    cout << s2 + s3;
  else if (s2 > s3 and s2 > s3)
    cout << s1 + s3;
  else if (s1 >= 1 and s1 >= 1 and s3 == 0)
    cout << s1 + s2;
  else
    cout << s2 + s1;
}
