#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1 = 0, x2 = 0, a, n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a % 2 == 1) {
      x1++;
    } else
      x2++;
  }
  cout << min(x1, x2);
}
