#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, i, n, ans = 0, k = 0, mx;
  cin >> n;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  ans = a[0] / 3;
  k = a[0] % 3;
  for (i = 1; i < n; i++) {
    mx = min(k, a[i] / 2);
    ans += mx;
    k -= mx;
    a[i] -= 2 * mx;
    ans += a[i] / 3;
    k += a[i] % 3;
  }
  cout << ans;
  return 0;
}
