object Main extends App {
	val n = scala.io.StdIn.readInt
	val a = new Array[Long](n)

	for(i<-0 until n){
		a(i) = scala.io.StdIn.readLong
	}

	var ans = 0L
	var sum = 0L

	for(x <- a){
		if(x == 0L){
			ans += sum/2L
			sum = 0L
		}else{
			sum += x
		}
	}

	ans += sum/2L

	println(ans)

}
