#include <bits/stdc++.h>
using namespace std;
int n, i, x, t1, t2;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (x == 2) t2++;
  }
  t1 = n - t2;
  if (t2 >= t1) {
    cout << t1;
    return 0;
  } else {
    cout << t2 + (t1 - t2) / 3;
    return 0;
  }
}
