#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, i, j, num, tmp;
long long ans, sum;
int main() {
  for (scanf("%d", &n), i = 1; i <= n; ++i) {
    scanf("%d", &j);
    tmp = min(1LL * j / 2, sum);
    sum -= tmp;
    ans += tmp;
    j -= tmp * 2;
    ans += j / 3;
    sum += j % 3;
  }
  printf("%lld\n", ans);
}
