#include <bits/stdc++.h>
using namespace std;
long long int arr[110];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  long long int ref = 0, ref1 = 0;
  int cost = 0;
  int fcost = INT_MAX;
  for (int i = 1; i <= n; i++) {
    ref = arr[i];
    for (int j = 1; j <= n; j++) {
      ref1 = arr[j];
      if (abs(ref1 - ref) % 2 == 0) {
        cost;
      } else {
        cost++;
      }
    }
    if (cost <= fcost) {
      fcost = cost;
    }
    cost = 0;
  }
  cout << fcost << endl;
  return 0;
}
