#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<int> v(4);
  int max_freq{};
  for (int i{0}, x; i < n; ++i) {
    std::cin >> x;
    max_freq = std::max(max_freq, ++v[x]);
  }
  std::cout << n - max_freq << std::endl;
}
