#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int o, q;
    o = 0;
    q = 0;
    for (int i = 0; i < n; i++) {
      long long a;
      cin >> a;
      if (a % 2 == 0)
        o++;
      else
        q++;
    }
    if (o > q)
      cout << q << endl;
    else
      cout << o << endl;
  }
  return 0;
}
