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