#include <bits/stdc++.h>
int main(void) {
  long long int arr[100005] = {0};
  long long int n = 0, ne = 0, no = 0;
  long long int res = 0, i = 0;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    if (arr[i] % 2 == 0)
      ne++;
    else
      no++;
  }
  if (no > ne) {
    res += ne;
    no -= ne;
    res += (no / 3);
  } else
    res += no;
  printf("%lld\n", res);
  return 0;
}
