#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cctype>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<cstring>
//#include<windows.h>
//#include<time.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mer make_pair
#define mme memset
using namespace std;

const double pie1=3.1415926;//π1
const double pie2=3.14159265358979;//π2
const double pie3=3.14159265358979323846;//π3
const int vbi=999999999;
const int vli=-vbi;
const long long vbl=999999999999999999;
const long long vll=-vbl;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pii,int> piii;
typedef pair<pii,pii> pi4;
typedef pair<pll,ll> plll;
typedef pair<int,pii> ipii;
typedef pair<ll,pll> lpll;
typedef pair<pll,pll> pl4;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef set<int> sti;
typedef set<ll> stl;
typedef set<pii> spi;
typedef set<pll> spl;
priority_queue<int> pqi;
priority_queue<ll> pql;
queue<int> qi;
queue<ll> ql;

/*void bin_v(){
	char bin[1000];
	gets(bin);
}*/

bool pss(int a){
	for(int i=2;i<=sqrt(a);i++)
		if(a%i==0)
			return false;
	return true;
}
/////////////////////////////////////////////////////////////////////////////////////////

int main(){
	//my name is Veex
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	int a[n+10];
	bool jo[n+10];
	for(int i=1;i<=n;i++){
		cin>>a[i];
		jo[i]=(a[i]%2==0);
	}
	ll sum=0;
	for(int i=1;i<=n;i++)
		if(a[i]==0)
			continue;
		else if(a[i+1]==0||i==n)
			sum+=a[i]/2;
		else if(jo[i]&&jo[i+1]){
			sum+=a[i]/2+a[i+1]/2;
			a[i]=a[i+1]=0;
		}
		else if(!jo[i]&&!jo[i+1]){
			int cha=min(a[i],a[i+1]);
			sum+=cha+(max(a[i],a[i+1])-cha)/2;
			a[i]=a[i+1]=0;
		}
		else if(jo[i]&&!jo[i+1]){
			sum+=a[i]/2+a[i+1]/2;
			a[i]=0;
			a[i+1]%=2;
		}
		else if(!jo[i]&&jo[i+1]){
			a[i]--;
			a[i+1]--;
			sum++;
			sum+=a[i]/2+a[i+1]/2;
			a[i]=0;
			a[i+1]%=2;
		}
	cout<<sum;
	return 0;
}
