#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = (0); i < (int)(n); ++i) cin >> a[i];
  long long int ans = 0;
  long long int debt = 0;
  for (int i = n - 1; i >= 0; --i) {
    int k = a[i] / 2;
    a[i] -= k * 2;
    debt += k;
    if (a[i] > 0 && debt > 0) {
      ans++;
      debt--;
    }
  }
  ans += (debt * 2) / 3;
  cout << ans << endl;
  return 0;
}
