#include <bits/stdc++.h>
using namespace std;
long long a[1000000];
int main() {
  long long i, n;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  long long j = 0, m = 0, k, t;
  for (i = 0; i < n; i++) {
    if (j == 0) {
      if (a[i] >= 3) {
        t = a[i] / 3;
        m += t;
        a[i] = a[i] % 3;
      }
      j = a[i];
      continue;
    }
    k = min(j, a[i] / 2);
    j -= k;
    a[i] -= k * 2;
    m += k;
    m += a[i] / 3;
    a[i] = a[i] % 3;
    j += a[i];
  }
  printf("%lld\n", m);
  return 0;
}
