#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c1 = 0, c2 = 0;
  int t;
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    if (t == 1)
      c1++;
    else
      c2++;
  }
  int ans = 0;
  if (c2) {
    ans = min(c1, c2);
    c1 -= ans;
    c2 -= ans;
  }
  if (c1) {
    ans += c1 / 3;
  }
  cout << ans << endl;
  return 0;
}
