#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n), o, e;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] % 2)
      o.push_back(v[i]);
    else
      e.push_back(v[i]);
  }
  int os = o.size(), es = e.size();
  cout << min(o.size(), e.size()) << endl;
  return 0;
}
