#include <bits/stdc++.h>
using namespace std;
int n;
long long a[300005];
void setup() {
  cin >> n;
  for (auto i = 1; i <= n; ++i) cin >> a[i];
}
void xuly() {
  long long ans = 0, spare = 0;
  for (auto i = 1; i <= n; ++i) {
    long long withSmaller = min(a[i] / 2, spare);
    ans += withSmaller;
    spare -= withSmaller;
    a[i] -= (withSmaller << 1);
    ans += a[i] / 3;
    a[i] %= 3;
    spare += a[i];
  }
  cout << ans << '\n';
}
int main() {
  iostream::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  xuly();
  return 0;
}
