#include <cstdio>
int N;
long long a[100001], O;
int main()
{
	scanf("%d", &N);
	for (int i = 1; i <= N; i++)
		scanf("%lld", a + i);
	for (int i = 1; i <= N; i++)
		if (a[i])
		{
			long long G = a[i];
			while (i < N && a[i + 1])
				G += a[++i];
			O += G >> 1;
		}
	printf("%lld\n", O);
}
