#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  t = 1;
  for (long long tc = 0; tc < t; tc++) {
    long long n;
    cin >> n;
    long long arr[n], cnt_odd = 0, cnt_even = 0;
    for (long long i1 = 0; i1 < n; i1++) {
      cin >> arr[i1];
      cnt_even += (arr[i1] % 2 == 0);
      cnt_odd += (arr[i1] % 2 == 1);
    }
    long long ans = min(cnt_odd, cnt_even);
    cnt_even -= ans;
    cnt_odd -= ans;
    if (cnt_odd > 0) {
      ans += cnt_odd / 3;
    }
    cout << ans << "\n";
  }
  return 0;
}
