#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e2 + 2;
int x[MAX], n;
int main() {
  cin >> n;
  map<int, int> pos;
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
    pos[x[i]]++;
  }
  sort(x, x + n);
  int len = unique(x, x + n) - x;
  int ans = 0x3f3f3f3f;
  int sum;
  for (int i = 0; i < len; ++i) {
    sum = 0;
    for (int j = 0; j < len; ++j) {
      if (x[j] != x[i]) {
        if (abs(x[i] - x[j]) & 1) sum += pos[x[j]];
      }
    }
    ans = min(ans, sum);
  }
  cout << ans;
  return 0;
}
