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