#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n = 0;
  cin >> n;
  int arr[n];
  for (int a = 0; a < n; a++) cin >> arr[a];
  sort(arr, arr + n);
  int ct = 0;
  for (int a = 0; a < n; a++)
    if (arr[a] % 2 == 0) ct += 1;
  if (ct < n - ct)
    cout << ct;
  else
    cout << n - ct;
}
