#include <bits/stdc++.h>
using namespace std;
int N;
int A, B;
int main() {
  scanf("%d", &N);
  for (int i = 1, x; i <= N; i++) {
    scanf("%d", &x);
    if (x == 1)
      A++;
    else
      B++;
  }
  int ans = 0;
  int a1 = min(A, B);
  A -= a1, B -= a1;
  ans += a1;
  if (A >= 0) ans += (A / 3);
  printf("%d\n", ans);
}
