#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[3] = {0};
  for (int x, i = 0; i < n; i++) {
    cin >> x, arr[x - 1]++;
  }
  std::cout << n - max(max(arr[0], arr[1]), arr[2]) << "\n";
}
