#include <bits/stdc++.h>
using namespace std;
long long int binarysearch(long long int l, long long int r, long long int n,
                           vector<long long int> &v) {
  while (l <= r) {
    long long int mid = (r + l) / 2;
    if (v[mid] == n) {
      return mid;
    } else if (v[mid] > n) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return -1;
}
void solve() {
  long long int n, o = 0, e = 0, x;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    if (x % 2 == 0) {
      e++;
    } else {
      o++;
    }
  }
  long long int ans = 0, mn;
  mn = min(o, e);
  if (mn == o) {
    cout << mn;
    return;
  }
  ans += mn;
  o -= mn;
  e -= mn;
  ans += (o / 3);
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
