#include <bits/stdc++.h>
class Solver {
 public:
  Solver() = default;
  void read() {
    int n;
    std::cin >> n;
    int r2, r1;
    r1 = 0;
    r2 = 0;
    for (int i = 0; i < n; ++i) {
      int a;
      std::cin >> a;
      if (a == 2) {
        r2++;
      } else {
        r1++;
      }
    }
    int s = std::min(r1, r2);
    if (r1 > s) {
      s += (r1 - s) / 3;
    }
    std::cout << s << std::endl;
  }
  void solve() {}
  void write() {}
};
int main() {
  Solver solver;
  solver.read();
  solver.solve();
  solver.write();
  return 0;
}
