from sys import stdin



def main():

	N = int(stdin.readline().strip())

	i,card = 0,[-1 for x in range(N)]

	while i < N:

		x = int(stdin.readline().strip())

		card[i] = x

		i+=1

	i,ans = 0,0

	while i < N:

		if card[i]%2==0:

			ans+= card[i]//2

			card[i] = 0

		else:

			ans+=(card[i]-1)//2

			card[i] = 1

			if i+1 < N and card[i+1] >=1:

				ans+=1

				card[i],card[i+1] = 0, card[i+1]-1

		i+=1

	print(ans)

main()
from sys import stdin



def main():

    nums = int(stdin.readline())

    l = []

    actual = int(stdin.readline())

    total = 0

    for x in range(nums-1):

        total += actual//2

        temp = int(stdin.readline())

        if temp != 0:

            actual = actual%2 + temp

        else:

            actual = temp



    print((total+actual//2))

        

        

    

main()

from sys import stdin


def main():
    N = int(stdin.readline().strip())
    i, card = 0, [-1 for x in range(N)]
    while i < N:
        x = int(stdin.readline().strip())
        card[i] = x
        i += 1
    i, ans = 0, 0
    while i < N:
        if card[i] % 2 == 0:
            ans += card[i] // 2
            card[i] = 0
        else:
            ans += (card[i] - 1) // 2
            card[i] = 1
            if i + 1 < N and card[i + 1] >= 1:
                ans += 1
                card[i], card[i + 1] = 0, card[i + 1] - 1
        i += 1
    print(ans)


main()

from sys import stdin


def main():
    nums = int(stdin.readline())
    l = []
    actual = int(stdin.readline())
    total = 0
    for x in range(nums - 1):
        total += actual // 2
        temp = int(stdin.readline())
        if temp != 0:
            actual = actual % 2 + temp
        else:
            actual = temp
    print((total + actual // 2))


main()

-    N = int(stdin.readline().strip()) -    i, card = 0, [-1 for x in range(N)] -    while i < N: -        x = int(stdin.readline().strip()) -        card[i] = x -        i += 1 -    i, ans = 0, 0 -    while i < N: -        if card[i] % 2 == 0: -            ans += card[i] // 2 -            card[i] = 0 +    nums = int(stdin.readline()) +    l = [] +    actual = int(stdin.readline()) +    total = 0 +    for x in range(nums - 1): +        total += actual // 2 +        temp = int(stdin.readline()) +        if temp != 0: +            actual = actual % 2 + temp -            ans += (card[i] - 1) // 2 -            card[i] = 1 -            if i + 1 < N and card[i + 1] >= 1: -                ans += 1 -                card[i], card[i + 1] = 0, card[i + 1] - 1 -        i += 1 -    print(ans) +            actual = temp +    print((total + actual // 2))