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