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