#include <bits/stdc++.h>
using namespace std;
const long long MOD = LLONG_MAX;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long power(long long x, unsigned long long y) {
  long long res = 1;
  x = x % MOD;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    y = y >> 1;
    x = (x * x) % MOD;
  }
  return res;
}
void solve() {
  long long n, m, b, c, d, ans = 0, one = 0;
  cin >> n;
  long long a[n];
  for (long long i = (long long)0; i < n; i++) {
    cin >> a[i];
    if (a[i] >= 2 * one) {
      a[i] -= 2 * one;
      ans += one + a[i] / 3;
      one = a[i] % 3;
    } else {
      one += a[i] % 2;
      one -= a[i] / 2;
      ans += a[i] / 2;
    }
  }
  cout << ans << '\n';
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) solve();
}
