#include <bits/stdc++.h>
using namespace std;
const int N = 200005, M = 1000000007, BIG = 0x3f3f3f3f;
long long n;
vector<long long> a;
bool Read() {
  cin >> n;
  if (cin.eof()) return 0;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  return 1;
}
void Process() {
  long long ans = 0, i = 0, j = 0;
  while (j < n) {
    if (a[j] < 2) {
      j++;
      continue;
    }
    while (i < j && a[i] == 0) i++;
    if (i == j) {
      ans += a[j] / 3;
      a[j] %= 3;
      j++;
      continue;
    }
    if (a[i] * 2 < a[j]) {
      ans += a[i];
      a[j] -= a[i] * 2;
      i++;
    } else {
      a[i] -= a[j] / 2;
      ans += a[j] / 2;
      a[j] %= 2;
      j++;
    }
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  while (Read()) Process();
  return 0;
}
