import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	int n = readln.chomp.to!int;
	
	BigInt ans = BigInt(0);
	BigInt leftover = 0;
	
	foreach(i; 0 .. n){
		long a = readln.chomp.to!int;
		if(a <= leftover){
			ans += a;
			leftover = 0;
			}
		else{
			ans += leftover;
			leftover = a - leftover;
			ans += leftover / 2;
			leftover %= 2;
			}
		}
	
	ans.writeln;
	
	}