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