#include <bits/stdc++.h>
using namespace std;
const int N = 300030;
int a[N];
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0, sum = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    if (sum >= a[i] / 2) {
      ans += a[i] / 2;
      sum -= a[i] / 2;
      a[i] %= 2;
    } else {
      ans += sum;
      a[i] -= sum * 2;
      sum = 0;
    }
    ans += a[i] / 3;
    sum += a[i] % 3;
  }
  printf("%lld\n", ans);
  return 0;
}
