#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x = 0, y = 0, a;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    if (a % 2 == 0)
      x++;
    else
      y++;
  }
  if (x > y || x == y)
    cout << y;
  else
    cout << x;
}
