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