#include <bits/stdc++.h>
template <typename T>
inline T MIN(T a, T b) {
  return a < b ? a : b;
}
template <typename T>
inline T MAX(T a, T b) {
  return a > b ? a : b;
}
using namespace std;
void reop() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  int n, even = 0, odd = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    ;
    cin >> x;
    if (x & 1)
      odd++;
    else
      even++;
  }
  if (even >= odd)
    cout << odd;
  else {
    cout << even + (odd - even) / 3;
  }
  return 0;
}
