#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 15;
const int inf = 0x3f3f3f3f;
int a[N];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    long long sum = 0, left = 0;
    for (int i = 1; i <= n; i++) {
      int v;
      scanf("%d", &v);
      if (v != 1) {
        int tmp = min(left, v / 2LL);
        left -= tmp;
        v -= 2 * tmp;
        sum += tmp + v / 3;
        left += v % 3;
      } else {
        left += v;
      }
    }
    printf("%lld\n", sum);
  }
}
