#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long powm(long long base, long long exp, long long mod = 1000000007) {
  base %= mod;
  long long ans = 1;
  while (exp) {
    if (exp & 1LL) ans = (ans * base) % mod;
    exp >>= 1LL, base = (base * base) % mod;
  }
  return ans;
}
long long a[300005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  long long prev = 0;
  for (long long i = 0; i < n; i++) {
    long long temp = min(a[i] / 2, prev);
    ans += temp;
    a[i] -= 2 * temp;
    prev -= temp;
    ans += a[i] / 3;
    prev += a[i] % 3;
  }
  cout << ans << '\n';
}
