#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, cnt1 = 0, cnt2 = 0;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 2) {
      cnt2++;
    } else {
      cnt1++;
    }
  }
  if (cnt2 >= cnt1) {
    cout << cnt1;
  } else {
    cout << cnt2 + (cnt1 - cnt2) / 3;
  }
  return 0;
}
