#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const long long int N = 60;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  long long int d = 0, e = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] & 1)
      d++;
    else
      e++;
  }
  long long int ans = 0;
  ans = min(e, d);
  d -= min(e, d);
  ans += (d / 3);
  cout << ans << "\n";
}
