#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  int p = 0;
  for (int i = 0; i < n; i++) {
    ans += a[i] / 3;
    a[i] %= 3;
    p = max(p, i + 1);
    while (a[i]) {
      a[i]--;
      while (p < n && a[p] < 2) p++;
      if (p < n) {
        a[p] -= 2;
        ans++;
      }
    }
  }
  cout << ans << endl;
}
