#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, a[200001], cnt = 0, odd = 0, even = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2)
      odd++;
    else
      even++;
  }
  if (even >= odd) {
    cout << odd;
  } else {
    cout << even + (odd - even) / 3;
  }
}
