#include <bits/stdc++.h>
using namespace std;
int zhs(int n) { return n * (n - 1) / 2; }
bool isP(int n) {
  for (int i = 2; i <= sqrt(n); ++i)
    if (n % i == 0) return false;
  return true;
}
bool yuanyin6(char c) {
  switch (c) {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
    case 'y':
      return true;
      break;
    default:
      return false;
      break;
  }
}
int a[100005] = {0};
int main() {
  int n;
  cin >> n;
  int n1 = 0, n2 = 0;
  for (int i = 0; i < n; ++i) {
    int temp;
    cin >> temp;
    if (temp == 1)
      n1++;
    else
      n2++;
  }
  int num = min(n1, n2);
  num += (n1 - num) / 3;
  cout << num << endl;
  return 0;
}
