#include <bits/stdc++.h>
int main() {
  int odd = 0, even = 0;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x % 2)
      odd++;
    else
      even++;
  }
  while (odd - 1 > even && odd > 2) {
    odd -= 2;
    even++;
  }
  int ans;
  if (odd < even)
    ans = odd;
  else
    ans = even;
  printf("%d", ans);
  return 0;
}
