#include <bits/stdc++.h>
using namespace std;
int a[210];
int main(void) {
  int n;
  cin >> n;
  int s1 = 0, s2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      s1++;
    else
      s2++;
  }
  if (s1 < s2)
    printf("%d\n", s1);
  else
    printf("%d\n", s2);
  return 0;
}
