#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
vector<long long int> v, v1, v2, c;
int main() {
  long long int n, x, y, z, l, r;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    if (x % 2 == 0) {
      v1.push_back(x);
    } else {
      v2.push_back(x);
    }
  }
  if (v2.size() <= v1.size()) {
    cout << v2.size() << endl;
  } else {
    cout << v1.size() + ((v2.size() - v1.size()) / 3);
  }
}
