#include <bits/stdc++.h>
using namespace std;
inline void normal(long long int& a) { a = (a + 998244353) % 998244353; }
inline int modMul(long long int a, long long int b) {
  a %= 998244353, b %= 998244353;
  normal(a), normal(b);
  return (a * b) % 998244353;
}
inline int modAdd(long long int a, long long int b) {
  a %= 998244353, b %= 998244353;
  normal(a), normal(b);
  return (a + b) % 998244353;
}
inline int modSub(long long int a, long long int b) {
  a %= 998244353, b %= 998244353;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline int modPow(long long int b, long long int p) {
  int r = 1;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline int modInv(int a) { return modPow(a, 998244353 - 2); }
inline int modDiv(int a, int b) { return modMul(a, modInv(b)); }
inline int fact(int r) {
  int ans = 1;
  while (r) ans = modMul(ans, r), r--;
  return ans;
}
inline int invfact(int r) {
  int ans = 1;
  while (r) ans = modMul(ans, modInv(r)), r--;
  return ans;
}
inline double dgcd(double a, double b) {
  if (a < b) return dgcd(b, a);
  if (b < .0001) return a;
  return dgcd(b, fmod(a, b));
}
const long long int N = 2e5 + 1;
const long long int INF = 2e18;
clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& q) {
  in >> q.first >> q.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2>& q) {
  out << q.first << " " << q.second;
  return out;
}
template <typename T1, typename T2>
pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2) {
  return {p1.first + p2.first, p1.second + p2.second};
}
template <typename T1, typename T2>
pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2) {
  return {p1.first - p2.first, p1.second - p2.second};
}
long long int power(long long int base, long long int exp) {
  long long int res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % 998244353;
    base = (base * base) % 998244353;
    exp /= 2;
  }
  return res % 998244353;
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  long long int m;
  cin >> m;
  long long int z = m;
  vector<long long int> a, b;
  long long int sum = 0, res = 0;
  for (long long int i = 0; i < z; i++) {
    long long int x;
    cin >> x;
    a.push_back(x);
  }
  for (long long int i = 0; i < z; i++) {
    if (a[i] % 2)
      sum++;
    else
      res++;
  }
  if (sum <= res)
    cout << sum;
  else {
    long long int p = res;
    long long int q = (sum - res) / 3;
    p = res + q;
    cout << p << '\n';
  }
  return 0;
}
