#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    a[m]++;
  }
  int x = a[1];
  int y = a[2];
  int ans = 0;
  if (a[1] >= a[2]) {
    ans = a[2];
    ans += (a[1] - a[2]) / 3;
  } else
    ans = a[1];
  cout << ans << endl;
  return 0;
}
