#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> v(n + 1, 0);
  for (long long int i = 1; i <= n; i++) cin >> v[i];
  long long int l = 0, ans = 0;
  for (long long int i = 1; i <= n; i++) {
    long long int a = v[i];
    if (a >= l * 2) {
      a -= l * 2;
      ans += l + a / 3;
      l = a % 3;
    } else {
      ans += a / 2;
      l = l - a / 2 + a % 2;
    }
  }
  cout << ans << "\n";
  return 0;
}
