#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x == 1)
      cnt1++;
    else
      cnt2++;
  }
  if (cnt1 <= cnt2)
    cout << cnt1 << endl;
  else
    cout << cnt2 + (cnt1 - cnt2) / 3 << endl;
  return 0;
}
