#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 100;
int a[maxn], b[maxn], sum[maxn];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long long cnt = 0;
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (2 * cnt <= a[i]) {
      ans += cnt;
      a[i] -= 2 * cnt;
      ans += a[i] / 3;
      a[i] %= 3;
      cnt = a[i];
    } else {
      ans += a[i] / 2;
      cnt -= a[i] / 2;
      a[i] %= 2;
      cnt += a[i];
    }
  }
  cout << ans << '\n';
  return 0;
}
