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