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