#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n;
int a[300000 + 10];
long long final = 0;
long long ret = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) {
    long long cost = ret;
    if (a[i] / 2 > ret) {
      a[i] -= ret * 2;
      final += ret;
      ret = 0;
      final += a[i] / 3;
      a[i] %= 3;
      ret += a[i];
    } else {
      final += a[i] / 2;
      ret -= a[i] / 2;
      ret += a[i] & 1;
    }
  }
  printf("%I64d\n", final);
  return 0;
}
