#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, a[100000], cnt1, cnt2, second;
int32_t main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      cnt1++;
    else
      cnt2++;
  }
  second = min(cnt1, cnt2);
  cnt2 = max(0LL, cnt2 - min(cnt2, cnt1));
  while (cnt2 >= 3) {
    cnt2 = cnt2 - 3;
    second++;
  }
  cout << second;
  return 0;
}
