#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int n, even = 0, odd = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int val;
    cin >> val;
    if (val % 2)
      odd++;
    else
      even++;
  }
  int ans = min(even, odd);
  even -= ans;
  odd -= ans;
  if (odd != 0) ans += odd / 3;
  cout << ans;
  return 0;
}
