#include <bits/stdc++.h>
int main() {
  int n, i, count = 0, flag = 0, team = 0, a[200000];
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1) {
      count++;
    }
    if (a[i] == 2) {
      flag++;
    }
  }
  if (count != 0 && flag == 0) {
    team = count / 3;
    printf("%d", team);
    return 0;
  }
  if (count == 0) {
    printf("0");
    return 0;
  }
  team = 0;
  if (flag > count && count != 0) {
    team = team + count;
    count = 0;
    flag = flag - count;
    printf("%d", team);
    return 0;
  } else if (count > flag) {
    team = team + flag;
    count = count - flag;
    if (count >= 3) {
      team = team + (count / 3);
    }
    printf("%d", team);
    return 0;
  } else if (flag == count) {
    printf("%d", flag);
    return 0;
  }
}
