#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  int oddCount = 0;
  int evenCount = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] % 2 == 1)
      oddCount++;
    else
      evenCount++;
  }
  int answer = 0;
  if (oddCount == evenCount) {
    answer = oddCount;
  } else if (oddCount < evenCount) {
    answer = oddCount;
  } else {
    answer = evenCount;
    oddCount -= evenCount;
    answer += (oddCount / 3);
  }
  cout << answer << "\n";
  return 0;
}
