#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& s) {
  s = 0;
  int f = 0;
  char c = getchar();
  while (!isdigit(c)) f |= (c == '-'), c = getchar();
  while (isdigit(c)) s = s * 10 + (c ^ 48), c = getchar();
  s = f ? -s : s;
}
const int _ = 300010;
int n, a[_];
int main() {
  read(n);
  for (register int i = 1; i <= n; ++i) read(a[i]);
  long long cnt = 0, ans = 0;
  for (register int i = n; i >= 1; --i) {
    cnt += a[i] >> 1;
    if (a[i] & 1 && cnt > 0) --cnt, ++ans;
  }
  ans += (cnt << 1) / 3;
  printf("%lld\n", ans);
  return 0;
}
