#include <bits/stdc++.h>
using namespace std;
struct ql {
  long long q, m;
  ql() {}
  ql(long long a, long long b) {
    m = a;
    q = b;
  }
};
ql tree[5 * 1000];
ql merge_(long long tl, long long tr, long long v) {
  if (tl == tr) return tree[v];
  long long m1 = tree[2 * v + 1].m;
  long long m2 = tree[2 * v + 2].m;
  long long q1 = tree[2 * v + 1].q;
  long long q2 = tree[2 * v + 2].q;
  if (m1 == m2) {
    return ql(m1, q1 + q2);
  } else if (m1 > m2)
    return ql(m1, q1);
  else
    return ql(m2, q2);
}
void build(long long tl, long long tr, long long v, vector<long long> &p) {
  if (tl == tr)
    tree[v] = ql(p[tl], 1);
  else {
    long long tm = (tl + tr) / 2;
    build(tl, tm, 2 * v + 1, p);
    build(tm + 1, tr, 2 * v + 2, p);
    tree[v] = merge_(tl, tr, v);
  }
}
ql f(ql a, ql b) {
  if (a.m == b.m)
    return ql(a.m, a.q + b.q);
  else if (a.m > b.m)
    return ql(a.m, a.q);
  else
    return ql(b.m, b.q);
}
ql get(long long L, long long R, long long tl, long long tr, long long v) {
  if (L > tr || tl > R)
    return ql(-1, -1);
  else if (L <= tl && tr <= R)
    return tree[v];
  long long tm = (tl + tr) / 2;
  return f(get(L, R, tl, tm, 2 * v + 1), get(L, R, tm + 1, tr, 2 * v + 2));
}
signed main() {
  long long n;
  cin >> n;
  long long a = 0, b = 0;
  vector<long long> s(n);
  for (long long i = 0; i < n; ++i) cin >> s[i];
  ;
  for (auto i : s) {
    a += (i % 2 == 0);
    b += i % 2;
  }
  if (b >= a) {
    cout << a + (b - a) / 3;
  } else {
    cout << b;
  }
}
