#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%u", &n);
  int ch = 0;
  int nech = 0;
  for (int i = 0; i < n; i++) {
    int temp;
    scanf("%i", &temp);
    if (temp % 2 == 0) {
      ch++;
    } else {
      nech++;
    }
  }
  int an;
  if (ch < nech) {
    an = ch;
  } else {
    an = nech;
  }
  nech -= an;
  an += (nech / 3);
  printf("%i", an);
  return 0;
}
