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