#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int ans = 1e9 + 7;
int pos[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pos[i];
  }
  for (int i = 0; i < n; i++) {
    int tmp = 0;
    for (int j = 0; j < n; j++) {
      if ((pos[j] - pos[i]) % 2 != 0) {
        tmp++;
      }
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
