#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count_even = 0, count_odd = 0;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x % 2 == 0)
      count_even++;
    else
      count_odd++;
  }
  if (count_even < count_odd)
    cout << count_even + (count_odd - count_even) / 3;
  else
    cout << count_odd;
  return 0;
}
