#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007, mxn = 1000010;
int main() {
  long long n;
  cin >> n;
  long long ans = 0;
  long long ilm = 0;
  long long ter;
  for (int i = 0; i < n; i++) {
    cin >> ter;
    long long il1 = ilm;
    long long il2 = ter / 2;
    long long il = min(il1, il2);
    ans += il;
    ter -= il;
    ter -= il;
    ilm -= il;
    long long il3 = ter / 3;
    ans += il3;
    ter -= il3 * 3;
    ilm += ter;
  }
  cout << ans;
}
