#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ll n,ans=0,s=0;
    cin >> n;
    for(int i = 0;i < n;i ++){
        ll x;
        cin >> x;
        s += x;
        if(!x) {ans += s/2;s = 0;}
    }
    ans += s/2;
    cout << ans << endl;
    return 0;
}