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