#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char ch = getchar();
  long long s = 0, w = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
int n;
int a[110];
int main() {
  n = read();
  int sum1 = 0, sum2 = 0;
  for (register int i = 1; i <= n; i++) {
    int x = read();
    if (x & 1)
      sum1++;
    else
      sum2++;
  }
  printf("%d\n", min(sum1, sum2));
  return 0;
}
