#include <bits/stdc++.h>
using namespace std;
const int mm = 2e5 + 100;
long long int d[mm];
int main() {
  long long int n, m, i, j, t, a, b, c, p, k, kk;
  cin >> n;
  long long int s = 0, sum = 0;
  for (i = 1; i <= n; i++) {
    scanf("%lld", &d[i]);
    if (d[i] & 1)
      s++;
    else
      sum++;
  }
  if (sum >= s)
    ;
  else {
    p = sum;
    s -= sum;
    p += s / 3;
    s = p;
  }
  cout << s << endl;
}
