#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141592653589793;
int main() {
  long n, k, p = 0, np = 0, t = 0;
  cin >> n;
  for (long i = 0; i < n; i++) {
    cin >> k;
    if (k % 2 == 0)
      p++;
    else
      np++;
  }
  t = min(p, np);
  if (np > p) t += (np - p) / 3;
  cout << t;
  return 0;
}
