#include <iostream>
#include <algorithm>
using namespace std;
long long n,a,ans,p;
int main(void){
    scanf("%lld",&n);
    for(int i=0;i<n;i++){
        scanf("%lld",&a);
        p+=a;
        if(a==0||i==n-1){
            ans+=p/2;
            p=0;
        }
    }
    printf("%lld\n",ans);
}
