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