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