#include <bits/stdc++.h>
using namespace std;
const int MX = 3e5 + 10;
long long n, a[MX], ps[MX], f[MX];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], ps[i + 1] = ps[i] + a[i];
  f[0] = a[0] / 3;
  for (int i = 1; i < n; i++) {
    long long tmp = min(ps[i] - (f[i - 1] * 3), a[i] / 2);
    f[i] = f[i - 1] + tmp + (a[i] - 2 * tmp) / 3;
  }
  cout << f[n - 1];
}
