#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
long long i, j, k, l, n, m, sum, maxx, minn, ans, x, y, flag;
int main() {
  long long sheng = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> l;
    if (sheng * 2 <= l) {
      ans += sheng;
      l -= sheng * 2;
      sheng = 0;
    } else if (sheng * 2 > l) {
      ans += l / 2;
      sheng -= l / 2;
      if (l % 2 == 0)
        l = 0;
      else
        l = 1;
    }
    if (l / 3 > 0) ans += l / 3;
    if (l % 3 == 2 && sheng > 0) {
      sheng -= 1;
      ans += 1;
    }
    if (l % 3 == 2 && sheng == 0) {
      sheng += 2;
    }
    if (l % 3 == 1) sheng += 1;
  }
  cout << ans << endl;
  return 0;
}
