#include <bits/stdc++.h>
int N;
long long t, rm, ans;
int main() {
  scanf(" %d", &N);
  for (int i = 0; i < N; ++i) {
    scanf(" %I64d", &t);
    ans += t;
    if (t >= 2 * rm)
      rm = (t - 2 * rm) % 3;
    else
      rm = rm - t / 2 + t % 2;
  }
  printf("%I64d\n", (ans - rm) / 3);
  return 0;
}
