#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n;
long long l = 0;
long long a[300010];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%lld", a + i);
  }
  long long ans = 0;
  long long onecnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) {
      onecnt++;
      continue;
    }
    if (a[i] >= 2 * onecnt) {
      ans += onecnt;
      a[i] -= 2 * onecnt;
      onecnt = 0;
      onecnt = a[i] % 3;
      ans += a[i] / 3;
    } else {
      ans += a[i] / 2;
      onecnt -= a[i] / 2;
      onecnt += a[i] % 2;
    }
  }
  cout << ans << endl;
  return 0;
}
