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