#include <bits/stdc++.h>
using namespace std;
const long long INF = 10E16;
const long long mask = (1 << 9) - 1;
const long long base = 100000000000;
struct pp {
  long long fi, sc;
  bool operator<(const pp& b) const {
    if (fi == b.fi) return sc < b.sc;
    return fi < b.fi;
  }
  bool operator>(const pp& b) const {
    if (fi == b.fi) return sc > b.sc;
    return fi > b.fi;
  }
  bool operator==(const pp& b) const {
    if (fi == b.fi && sc == b.sc) return 1;
    return 0;
  }
};
long long n;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  long long res = 0, r1 = 0;
  for (long long i = 1; i <= n; i++) {
    long long x = 0;
    cin >> x;
    long long cof = min(x / 2, r1);
    x -= cof * 2;
    res += cof;
    r1 -= cof;
    cof = x / 3;
    x %= 3;
    res += cof;
    r1 += x;
  }
  cout << res << endl;
  return 0;
}
