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