#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[3];
  for (int i = 0; i < 3; i++) b[i] = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (a[i] == 1)
      b[0]++;
    else if (a[i] == 2)
      b[1]++;
    else
      b[2]++;
  }
  if (b[0] > b[1] && b[0] > b[2])
    cout << b[1] + b[2];
  else if (b[1] > b[0] && b[1] > b[2])
    cout << b[0] + b[2];
  else if (b[2] > b[1] && b[2] > b[0])
    cout << b[1] + b[0];
  else if (n == 2 && a[1] != a[0])
    cout << "1";
  else if (n == 2 && a[0] == a[1])
    cout << "0";
  else
    cout << b[1] + b[2];
}
