#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, x1 = 0;
  cin >> n;
  long long int arr[n + 2];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] % 2 == 0)
      x++;
    else
      x1++;
  }
  if (x < x1)
    cout << x << endl;
  else
    cout << x1 << endl;
  return 0;
}
