#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  long long res = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  res = a[0] / 3;
  long long one = a[0] % 3;
  for (int i = 1; i < n; i++) {
    if (!one) {
      res += a[i] / 3;
      one += a[i] % 3;
    } else {
      long long need = min(one, 1LL * a[i] / 2);
      res += need;
      a[i] -= need * 2;
      one -= need;
      res += a[i] / 3;
      one += a[i] % 3;
    }
  }
  cout << res << endl;
  return 0;
}
