#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, o = 0, e = 0;
  cin >> n;
  for (i = 0; i < n; i = i + 1) {
    long long int x;
    cin >> x;
    if (x % 2 == 0)
      e = e + 1;
    else
      o = o + 1;
  }
  long long int res = min(o, e);
  o = o - res;
  res = res + (o / 3);
  cout << res << endl;
}
