#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  long long int odd = 0, even = 0;
  long long int arr[120] = {0};
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  if (even == n) {
    cout << "0\n";
  } else if (odd == n) {
    cout << "0\n";
  } else if (odd > even) {
    cout << even << "\n";
  } else if (even > odd) {
    cout << odd << "\n";
  } else {
    cout << odd << "\n";
  }
  return 0;
}
