#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, o = 0, x, t = 0, ans;
  cin >> n;
  while (n--) {
    cin >> x;
    if (x == 1)
      o++;
    else
      t++;
  }
  ans = min(o, t);
  o -= min(o, t);
  ans += o / 3;
  cout << ans;
  return 0;
}
