#include <bits/stdc++.h>
using namespace std;
long sl[10];
int main() {
  long n, x;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    ++sl[x];
  }
  long res = 0;
  res = min(sl[1], sl[2]);
  sl[1] -= res;
  sl[2] -= res;
  if (sl[1] > 0) res += sl[1] / 3;
  cout << res;
}
