#include <bits/stdc++.h>
using namespace std;
long long sti[300010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &sti[i]);
  }
  long long cnt = 0;
  long long last = 0;
  for (int i = 0; i < n; i++) {
    if (sti[i] < 2 || (i == 0 && sti[i] <= 2)) {
      last += sti[i];
    } else if (sti[i] >= 2) {
      long long m = sti[i] / 2;
      long long k = min(last, m);
      sti[i] -= k * 2;
      last -= k;
      cnt += k;
      cnt += sti[i] / 3;
      last += sti[i] % 3;
    }
  }
  cout << cnt << endl;
}
