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