#include <bits/stdc++.h>
using namespace std;
template <typename tp>
inline void read(tp &x) {
  x = 0;
  char c = getchar();
  int f = 0;
  for (; c < '0' || c > '9'; f |= c == '-', c = getchar())
    ;
  for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar())
    ;
  if (f) x = -x;
}
const long long N = 3e5 + 233;
long long n, a[N];
signed main(void) {
  read(n);
  for (register long long i = 1; i <= (n); i++) read(a[i]);
  long long ans = 0, c1 = 0;
  for (register long long i = 1; i <= (n); i++) {
    long long cut = min(c1, a[i] / 2);
    ans += cut;
    c1 -= cut;
    a[i] -= cut * 2;
    if (!c1) {
      long long cut = a[i] / 3;
      ans += cut;
      a[i] -= cut * 3;
    }
    c1 += a[i];
  }
  cout << ans << "\n";
}
