#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    cin >> a[i];
  }
  long long res = 0;
  long long va = 1;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    res += a[i] / 3;
    a[i] -= (a[i] / 3) * 3;
    if (a[i] > 0) {
      while ((a[va] < 2 || i == va) && va < n) va++;
      if (va != n) {
        res++;
        a[va] -= 2;
        a[i]--;
        if (a[i] > 0) {
          while ((a[va] < 2 || i == va) && va < n) va++;
          if (va != n) {
            res++;
            a[va] -= 2;
            a[i]--;
          }
        }
      }
    }
  }
  cout << res;
  return 0;
}
