#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> arr(n);
  long long cntEven = 0, cntOdd = 0;
  for (long long i = 0; i < n; ++i) {
    cin >> arr[i];
    cntEven += arr[i] % 2 == 0 ? 1 : 0;
    cntOdd += arr[i] % 2 != 0 ? 1 : 0;
  }
  cout << min(cntEven, cntOdd);
}
