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