#include <bits/stdc++.h>
using namespace std;
const long double epsylon = 1e-9;
const std::string PROGRAM_NAME = "ivo";
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)a.size(); ++i) {
    scanf("%d", &a[i]);
  }
  long long doubles = 0;
  long long total = 0;
  long long lost = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] == 1) {
      if (doubles == 0) {
        lost++;
      } else {
        doubles -= 1;
        total++;
      }
    } else if (a[i] % 2 == 0) {
      doubles += a[i] / 2;
    } else if (a[i] == 3) {
      total++;
    } else {
      doubles += (a[i] - 3) / 2;
      total++;
    }
  }
  total += (doubles * 2) / 3;
  cout << total << endl;
  return 0;
}
