#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, one = 0, two = 0, t;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    if (t == 1)
      one++;
    else
      two++;
  }
  int ans = 0;
  if (one > two) {
    ans += two;
    one -= two;
    two = 0;
  }
  if (two) {
    ans += one;
    two -= one;
    one = 0;
  }
  ans += (one / 3);
  printf("%d\n", ans);
  return 0;
}
