#include <bits/stdc++.h>
using namespace std;
int main() {
  int x = 0;
  cin >> x;
  int array[x];
  for (int i = 0; i < x; i++) {
    cin >> array[i];
  }
  int one = 0, two = 0, three = 0;
  for (int j = 0; j < x; j++) {
    if (array[j] == 1) {
      one++;
    }
    if (array[j] == 2) {
      two++;
    }
    if (array[j] == 3) {
      three++;
    }
  }
  if (one > two && one > three) {
    cout << x - one;
  } else if (two > one && two > three) {
    cout << x - two;
  } else if (three > two && three > one) {
    cout << x - three;
  } else if (one == two) {
    cout << x - two;
  } else if (two == three) {
    cout << x - three;
  } else if (one == three) {
    cout << x - one;
  }
}
