#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x, c[2] = {0};
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> x;
    c[x & 1]++;
  }
  x = c[1] - c[0];
  if (x > 0)
    x = c[0] + (x / 3);
  else
    x = c[1];
  cout << x << endl;
  return 0;
}
