#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int A[n];
  int o = 0, e = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (A[i] % 2 == 1) o++;
    if (A[i] % 2 == 0) e++;
  }
  int ans = min(o, e);
  o -= ans;
  if (o > 0) o = o / 3;
  ans += o;
  cout << ans << endl;
  return 0;
}
