#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long even = 0;
  long long odd = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] % 2 == 0)
      even += 1;
    else
      odd += 1;
  }
  int result = min(even, odd);
  even -= result;
  odd -= result;
  while (odd >= 3) {
    result += 1;
    odd -= 3;
  }
  cout << result << "\n";
  return 0;
}
