#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 300000 + 10;
int n;
long long a[MAXN];
void solve() {
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  int j = 1;
  for (int i = 0; i < n; i++) {
    ans += a[i] / 3;
    a[i] %= 3;
    if (!a[i]) continue;
    if (j <= i) j = i + 1;
    while (a[j] < 2 && j < n) j++;
    if (j == n) break;
    a[i]--;
    a[j] -= 2;
    ans++;
    if (!a[i]) continue;
    while (a[j] < 2 && j < n) j++;
    if (j == n) break;
    a[i]--;
    a[j] -= 2;
    ans++;
  }
  printf("%I64d\n", ans);
}
int main(int argc, char* argv[]) {
  scanf("%d", &n);
  solve();
  return 0;
}
