#include <bits/stdc++.h>
using namespace std;
const long long N = 300007;
char buf[1000000], *p1, *p2;
inline char gc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long rd() {
  register long long f = 0;
  register char c = gc();
  while (c < 48 || c > 57) c = gc();
  while (c > 47 && c < 58) f = f * 10 + (c ^ 48), c = gc();
  return f;
}
long long a[N];
signed main() {
  register long long n = rd(), i, j, k;
  long long ans = 0;
  for (i = 1; i <= n; ++i) a[i] = rd();
  long long sum = 0;
  for (i = 1, j = 1; i <= n; ++i) {
    long long v = min(sum, a[i] / 2);
    a[i] -= v * 2;
    sum -= v;
    ans += v;
    ans += a[i] / 3;
    sum += a[i] % 3;
  }
  printf("%I64d\n", ans);
  return 0;
}
