#include "bits/stdc++.h"
using namespace std;
long long a[300004];
int main()
{
int n;
cin>>n;
for (int i = 0; i < n; ++i) {
cin>>a[i];
}
long long b=a[0]/3;
a[0]%=3;
long long les=a[0];
for (int i = 1; i < n; ++i) {
long long num=min(les,a[i]/2);
les-=num;
a[i]-=num*2;
b+=num;
b+=a[i]/3;
a[i]%=3;
les+=a[i];
}
cout<<b;
}