#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  int odd = 0, even;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] & 1) odd++;
  }
  even = n - odd;
  int ans = 0;
  if (odd == 0)
    ans = 0;
  else if (odd <= even) {
    ans = odd;
  } else {
    ans = even;
    odd = odd - even;
    ans = ans + ((odd) / 3);
  }
  cout << ans << endl;
  return 0;
}
