#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a1, a2;
  a1 = 0;
  a2 = 0;
  scanf("%d\n", &n);
  while (n--) {
    scanf("%d\n", &k);
    if (k % 2 == 0) {
      a1++;
    } else {
      a2++;
    }
  }
  int sum = 0;
  int m = min(a1, a2);
  sum += m;
  a1 -= m;
  a2 -= m;
  sum += a2 / 3;
  printf("%d\n", sum);
}
