#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int from, to, dist;
  Edge(int u, int v, int d) : from(u), to(v), dist(d) {}
};
int n;
long long a[200];
long long ans = 1000000007;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    long long tmp = 0;
    for (int j = 1; j <= n; j++) {
      if (i == j)
        continue;
      else {
        if (abs(a[i] - a[j]) % 2 == 1) tmp++;
      }
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
