#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n], odd = 0, even = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[n];
    if (x[n] % 2 == 1) {
      odd++;
    } else {
      even++;
    }
  }
  if (odd > even) {
    cout << even << endl;
  } else {
    cout << odd << endl;
  }
  return 0;
}
