#include <bits/stdc++.h>
using namespace std;
int main() {
  int noOfGroups, noOfStudents, noOfGroupOfSizeOne, noOfGroupOfSizeTwo,
      totalTeams;
  noOfGroupOfSizeOne = totalTeams = 0;
  cin >> noOfGroups;
  for (int groupid = 1; groupid <= noOfGroups; ++groupid) {
    cin >> noOfStudents;
    noOfGroupOfSizeOne += (noOfStudents == 1 ? 1 : 0);
  }
  noOfGroupOfSizeTwo = noOfGroups - noOfGroupOfSizeOne;
  totalTeams = min(noOfGroupOfSizeOne, noOfGroupOfSizeTwo);
  noOfGroupOfSizeOne -= totalTeams;
  totalTeams += (noOfGroupOfSizeOne / 3);
  cout << totalTeams << endl;
  return 0;
}
