#include <bits/stdc++.h>
const int N = 100 * 1000 + 13;
int n;
int cnt = 0, other = 0;
void func_read() {
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2 == 1) {
      cnt++;
    } else {
      other++;
    }
  }
}
void solve() {
  if (other > cnt) {
    printf("%d\n", cnt);
  } else {
    int ans = 0;
    ans += other + (cnt - other) / 3;
    printf("%d\n", ans);
  }
}
int main(int argc, const char* argv[]) {
  func_read();
  solve();
  return 0;
}
