#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-5;
const double PI = acos(-1);
int n;
int a[300010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  while (cin >> n) {
    for (int i = (1); i <= (n); i++) cin >> a[i];
    int i = 1;
    long long ans = 0;
    for (int j = 1; j <= n;) {
      if (i == j) {
        ans += a[i] / 3;
        a[i] %= 3;
        j++;
      }
      int t = min(a[j] / 2, a[i]);
      a[j] -= 2 * t;
      a[i] -= t;
      ans += t;
      while (j <= n && a[j] < 2) j++;
      while (i <= n && a[i] == 0) i++;
    }
    cout << ans << endl;
  }
  return 0;
}
