#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n], c1 = 0, c2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      c1++;
    else
      c2++;
  }
  int ans = 0;
  ans = min(c1, c2);
  c1 -= ans;
  ans += c1 / 3;
  cout << ans;
}
