#include <bits/stdc++.h>
using namespace std;
const long long int N = 100005;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0, o = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> m, o += m & 1;
    }
    long long int e = n - o;
    cnt = min(o, e);
    o -= cnt;
    ans = cnt + o / 3;
    cout << ans;
  }
  return 0;
}
