#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
const unsigned int MOD = 1000000007;
long long int inf = 1000000000000000000;
template <class T>
T power(T a, long long int n) {
  T res = 1;
  while (n > 0) {
    if (n % 2) res = (res * a) % MOD;
    a = (a * a) % MOD, n = n / 2;
  }
  return res % MOD;
}
unsigned int factorial(unsigned int n) {
  if (n == 0) return 1;
  return n * factorial(n - 1);
}
bool isprime(int n) {
  if (n == 0) return false;
  if (n <= 1) return true;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
inline long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
int getsum(long long int n) {
  int sum;
  for (sum = 0; n > 0; sum += n % 10, n /= 10)
    ;
  return sum;
}
void tobin(int n) {
  int binaryNum[32];
  int i = 0;
  while (n > 0) {
    binaryNum[i] = n % 2;
    n = n / 2;
    i++;
  }
  for (int j = i - 1; j >= 0; j--) cout << binaryNum[j];
}
long long int nCr(long long int n, long long int k) {
  if (k > n) return 0;
  long long int res = 1;
  if (k > n - k) k = n - k;
  for (int i = 0; i < k; i++) res *= (n - i), res /= (i + 1);
  return res;
}
bool issorted(vector<long long int> arr) {
  bool flag = 1;
  for (int i = 1; i < arr.size(); i++) {
    flag = flag and (arr[i] > arr[i - 1]);
  }
  return flag;
}
bool isper(vector<long long int> perm, long long int n) {
  vector<long long int> temp;
  temp = perm;
  ;
  sort(temp.begin(), temp.end());
  ;
  bool flag = 1;
  for (int i = 0; i < n; i++) {
    if (temp[i] != i + 1) flag = 0;
  }
  return flag;
}
bool mysort(const pair<int, int> &a, const pair<int, int> &b) {
  return (abs(a.first - a.second) > abs(b.first - b.second));
}
vector<long long int> adj[1000000];
bool vis[1000000];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int odd = 0;
  for (long long int i = 0; i <= n - 1; i++) {
    long long int a;
    cin >> a;
    if (a % 2) odd++;
  }
  if (n - odd >= odd)
    cout << odd;
  else {
    long long int ans = (n - odd);
    odd = odd - (ans);
    ans += (odd) / 3;
    cout << ans;
  }
}
