#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
const int maxn = 5e5 + 10;
const int inf = 2e9;
const int maxm = 1e4 + 10;
const int mod = 998244353;
const int base = 5e6 + 10;
long long a[maxn];
int main() {
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    long long sum1 = 0;
    if (res > 0) {
      sum1 = min(res, a[i] / 2);
      res -= sum1;
      a[i] -= sum1 * 2;
    }
    long long sum2 = 0;
    sum2 = a[i] / 3;
    a[i] -= sum2 * 3;
    res += a[i];
    ans += sum1 + sum2;
  }
  printf("%lld\n", ans);
  return 0;
}
