#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int n;
  scanf("%d", &n);
  int c1 = 0, c2 = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    if (a == 1)
      ++c1;
    else
      ++c2;
  }
  int ans = min(c2, c1);
  c1 -= ans;
  if (c1 > 0) ans += c1 / 3;
  printf("%d\n", ans);
  return 0;
}
