#include <bits/stdc++.h>
using namespace std;
set<long long> st, sl;
set<long long>::iterator it, il, tt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a = 0, b = 0, c, d, e, f = 0, l, g, m, n, k, i, j, t, p = 0, q;
  cin >> n;
  f = 0;
  for (i = 0; i < n; i++) {
    cin >> a;
    if (2 * p <= a) {
      a -= 2 * p;
      f += p;
      p = 0;
      f += a / 3;
      a = a % 3;
    } else {
      p -= a / 2;
      f += a / 2;
      a %= 2;
    }
    p += a;
  }
  cout << f << '\n';
  return 0;
}
