#include <bits/stdc++.h>
const int MAXN = 3e5 + 5;
int n;
long long a[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", a + i);
  long long r = 0, ans = 0;
  for (int i = 1; i <= n; ++i) {
    long long t = std::min(a[i] / 2, r);
    ans += t;
    r -= t;
    a[i] -= 2 * t;
    ans += a[i] / 3;
    a[i] %= 3;
    r += a[i];
  }
  printf("%lld\n", ans);
  return 0;
}
