#include <bits/stdc++.h>
using namespace std;
void swapll(long long *a, long long *b) {
  long long tmp = *a;
  *a = *b;
  *b = tmp;
}
void swapc(char *a, char *b) {
  char tmp = *a;
  *a = *b;
  *b = tmp;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n, 0);
  for (long long i = 0; i < n; i++) cin >> v[i];
  ;
  vector<long long> store;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    sum = 0;
    for (long long j = 0; j < n; j++) {
      if (abs(v[i] - v[j]) % 2 == 1) {
        sum++;
      }
    }
    store.push_back(sum);
  }
  sort((store).begin(), (store).end());
  cout << store[0] << endl;
  return 0;
}
