#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, i, j, k, x, odd = 0, even = 0, ans = 0;
  cin >> n;
  while (n--) {
    cin >> x;
    if (x % 2 == 0)
      even++;
    else
      odd++;
  }
  ans = min(odd, even);
  odd -= ans;
  even -= ans;
  ans += odd / 3;
  cout << ans << "\n";
  return 0;
}
