#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int x = 0, y = 0;
  int arr[200005];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    if (arr[i] == 1)
      x++;
    else
      y++;
  }
  if (x > y)
    cout << y + (x - y) / 3;
  else
    cout << x;
  cout << endl;
  return 0;
}
