#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[200005] = {0};
  int c[5] = {0};
  int i = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
  }
  int ans = 0;
  ans = min(c[1], c[2]);
  c[2] -= ans;
  c[1] -= ans;
  ans += c[1] / 3;
  cout << ans << endl;
  return 0;
}
