#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using ull = unsigned long long;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const int dx[] = {0, -1, 1, 0, 1, -1, 1, -1};
const int dy[] = {1, 0, 0, -1, 1, -1, -1, 1};
const double EPS = 1e-9;
const int mod = 1e9 + 7;
const ll inf = 1e18L + 7;
const int N = 2e5 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &i : a) cin >> i;
  int o = 0, e = 0, ans = 0;
  for (int i = 0; i < n; ++i) {
    o += (a[i] % 2);
    e += (!(a[i] % 2));
  }
  ans += min(o, e);
  e -= ans;
  o -= ans;
  ans += (o / 3);
  cout << ans << '\n';
  return 0;
}
