#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long rem = 0;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a >= 2 * rem) {
      ans += rem;
      a -= (2 * rem);
      rem = 0;
    } else {
      long long to_use = a / 2;
      rem -= (to_use);
      ans += (to_use);
      a -= (to_use * 2);
    }
    ans += (a / 3);
    a = a % 3;
    rem += a;
  }
  cout << ans;
  return 0;
}
