#include <bits/stdc++.h>
using namespace std;
const int M = 3e5 + 5;
long long a[M], n;
long long f[M];
long long s;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  for (long long i = 1; i <= n; ++i) {
    long long u = a[i] - 2 * s;
    if (u >= 0) {
      f[i] = f[i - 1] + s + u / 3;
      s = u % 3;
    } else {
      s -= (a[i] / 2);
      f[i] = f[i - 1] + a[i] / 2;
      if (a[i] & 1) ++s;
    }
  }
  cout << f[n] << endl;
  return 0;
}
