#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int now, pre = 0;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> now;
    int tmp = min(pre, now / 2);
    now -= 2 * tmp;
    ans += tmp + now / 3;
    pre += now % 3 - tmp;
  }
  cout << ans;
}
