#include<iostream>
using namespace std;

int main() {
	int n, r = 0;
  	cin >> n;
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		long long a;
		cin >> a;
		if (a == 0)r = 0;
		ans += (a + r) / 2;
		r = (a + r) % 2;
	}
	cout << ans << endl;
}