#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int col1 = 0;
  int col2 = 0;
  for (int i = 0; i < n; ++i) {
    int q;
    cin >> q;
    if ((q & 1) == 0)
      col1++;
    else
      col2++;
  }
  cout << min(col1, col2);
}
