#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n;
  cin >> n;
  long long a[n], temp[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) {
    int coin = 0;
    if (a[i] % 2 == 0) {
      for (long long j = 0; j < n; j++) {
        if (a[j] % 2 != 0) coin++;
      }
    } else {
      for (long long j = 0; j < n; j++) {
        if (a[j] % 2 == 0) coin++;
      }
    }
    temp[i] = coin;
  }
  sort(temp, temp + n);
  cout << temp[0];
}
