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