#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int binomial(int n, int k) {
  if (k == 0 || k == n) return 1;
  return binomial(n - 1, k - 1) + binomial(n - 1, k);
}
vector<long long> factor;
vector<long long> prime(long long n) {
  for (long long d = 2; d * d <= n; d++) {
    while (n % d == 0) {
      factor.push_back(d);
      n /= d;
    }
  }
  if (n > 1) factor.push_back(n);
  return factor;
}
pair<int, int> fib(int n) {
  if (n == 0) return {0, 1};
  auto p = fib(n >> 1);
  int c = p.first * (2 * p.second - p.first);
  int d = p.first * p.first + p.second * p.second;
  if (n & 1)
    return {d, c + d};
  else
    return {c, d};
}
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  long long int o = 0, e = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) {
      e++;
    } else {
      o++;
    }
  }
  int l;
  if (o >= e) {
    o = o - e;
    l = (o / 3) + e;
  } else {
    l = o;
  }
  cout << l << endl;
}
