#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i += 1) cin >> a[i];
  long long ans = 0;
  long long rem = 0;
  for (long long i = 0; i < n; i += 1) {
    if (i == 0) {
      ans += a[i] / 3;
      rem += a[i] % 3;
    } else {
      long long val = min(rem, a[i] / 2);
      ans += val;
      a[i] -= val * 2;
      rem -= val;
      rem += a[i] % 3;
      ans += a[i] / 3;
      a[i] = a[i] % 3;
    }
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long tin = 1;
  while (tin--) {
    solve();
  }
  return 0;
}
