#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin>>n;

    int cards[n];
    for (int i = 0; i < n; ++i)
    {
        cin>>cards[i];
    }

    int cont = 0;
    for(int i = 0; i < n - 1; ++i)
    {
        if(cards[i+1]>=cards[i])
        {
            cards[i+1]-=cards[i];
            cont+=cards[i];
        }
        else
        {
            cards[i]-=cards[i+1];
            cont+=cards[i+1];
            cont+=cards[i]/2;
            cards[i+1]=0;
        }
    }
    cout<<cont+cards[n-1]/2<<endl;

    return 0;
}
