#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, odd = 0, even, ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v;
    if (v & 1) odd++;
  }
  even = n - odd;
  ans = min(odd, even);
  odd -= ans;
  ans += odd / 3;
  cout << ans << endl;
  return 0;
}
