#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int cnt[333333];
int main(void) {
  int n = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &cnt[i]);
  ll ans = 0;
  ll rem = 0;
  for (int i = 0; i < n; i++) {
    int kill = min<ll>(cnt[i] / 2, rem);
    ans += kill;
    rem -= kill;
    cnt[i] -= kill * 2;
    ans += cnt[i] / 3;
    cnt[i] %= 3;
    rem += cnt[i];
  }
  printf("%lld\n", ans);
  return 0;
}
