#include <bits/stdc++.h>
using namespace std;
const long long inf = 2000000005;
const long long INF = 4000000000000;
long long tab[1000005];
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> tab[i];
  }
  long long zost = 0;
  long long wy = 0;
  for (long long i = 0; i < n; i++) {
    if (zost > 0) {
      long long ile = min(zost, tab[i] / 2);
      zost -= ile;
      tab[i] -= ile * 2;
      wy += ile;
      wy += tab[i] / 3;
      tab[i] %= 3;
      zost += tab[i];
    } else {
      wy += tab[i] / 3;
      tab[i] %= 3;
      zost += tab[i];
    }
  }
  cout << wy;
}
