#include <iostream>
#include <cstdio>
#define N 100005
using namespace std;

typedef long long ll;
ll n, c, a[N];
int main()
{
	ll i;
	cin >> n;
	for (i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		c += (a[i] + a[i - 1]) / 2;
		if (a[i]) a[i] = (a[i] + a[i - 1]) % 2;
	}
    cout << c << endl;
    return 0;
}