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