#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  int odd = 0, even = 0;
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    if (val % 2)
      odd++;
    else
      even++;
  }
  if (odd > even) {
    cout << even + (odd - even) / 3 << "\n";
  } else
    cout << odd << "\n";
  return 0;
}
