#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<ll> a(n);
  for (auto &e : a) {
    cin >> e;
  }
  ll ans = 0;
  ll sum = 0;
  for (int i = 0; i < n; ++i) {
    ll leftovers = sum - ans * 3ll;
    sum += a[i];
    ll cur = min(a[i] / 2ll, leftovers);
    a[i] -= 2ll * cur;
    leftovers -= cur;
    cur += a[i] / 3ll;
    a[i] %= 3ll;
    ans += cur;
  }
  cout << ans << endl;
  return 0;
}
