#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> data(n), dif(n - 1), sum(n);
  for (int i = 0; i < n; i++) cin >> data[i];
  long long int ans = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    long long int tmp = min(cur, data[i] / 2);
    ans += tmp;
    data[i] -= tmp * 2;
    ans += data[i] / 3;
    cur -= tmp;
    cur += data[i] % 3;
  }
  cout << ans << endl;
}
