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