#include <bits/stdc++.h>
using namespace std;
long int ar[10013];
void Ok() {
  long long int a, b, c, d, e, f, g, h, t, i, j, k, l, m, n, Min, Max;
  long long int ans_1, ans_2, ans_3, cnt_1, cnt_2, cnt_3, flag_1, flag_2,
      flag_3, temp, sum;
  double aa, bb, cc, dd, ee, ff, gg;
  char aaa, bbb, ccc, ddd;
  string spc, in, store;
  cnt_1 = cnt_2 = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    if (a == 1)
      cnt_1++;
    else
      cnt_2++;
  }
  if (cnt_1 == 0)
    cout << "0" << endl;
  else if (cnt_2 == 0) {
    ans_1 = cnt_1 / 3;
    cout << ans_1 << endl;
  } else {
    Min = min(cnt_1, cnt_2);
    cnt_1 -= Min;
    cnt_2 -= Min;
    ans_1 = Min + (cnt_1 / 3);
    cout << ans_1 << endl;
  }
  return;
}
int main() {
  Ok();
  return 0;
}
