#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count_c = 0;
  int count_n = 0;
  vector<int> s(n);
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    if (q % 2 == 1) {
      count_n++;
    } else {
      count_c++;
    }
    s.push_back(q);
  }
  if (count_c >= count_n) {
    cout << count_n << '\n';
  } else {
    cout << count_c + ((count_n - count_c) / 3) << '\n';
  }
  return 0;
}
