#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, c = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] % 2 == 0) c++;
  }
  int ones = n - c;
  int twos = c;
  int teams = 0;
  if (ones >= twos) {
    teams += twos;
    ones -= twos;
  } else {
    teams += ones;
    ones = 0;
  }
  if (ones > 0) {
    teams += ones / 3;
  }
  cout << teams;
  return 0;
}
