N = int(eval(input()))

A = list(int(eval(input())) for i in range(N))



ans = 0

for i in range(N) :

    ans += A[i]//2

    if i != N-1 :

        if A[i+1] >= 1 :

            A[i+1] += A[i] % 2

print(ans)

N = int(eval(input()))

A = [int(eval(input())) for i in range(N)]



ans = 0

cnt = 0



for a in A :

    ans += (a+cnt) // 2

    if a == 0 :

        cnt = 0

    else :

        cnt = (a+cnt) % 2



print(ans)

N = int(eval(input()))
A = list(int(eval(input())) for i in range(N))
ans = 0
for i in range(N):
    ans += A[i] // 2
    if i != N - 1:
        if A[i + 1] >= 1:
            A[i + 1] += A[i] % 2
print(ans)

N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
ans = 0
cnt = 0
for a in A:
    ans += (a + cnt) // 2
    if a == 0:
        cnt = 0
    else:
        cnt = (a + cnt) % 2
print(ans)

-A = list(int(eval(input())) for i in range(N)) +A = [int(eval(input())) for i in range(N)] -for i in range(N): -    ans += A[i] // 2 -    if i != N - 1: -        if A[i + 1] >= 1: -            A[i + 1] += A[i] % 2 +cnt = 0 +for a in A: +    ans += (a + cnt) // 2 +    if a == 0: +        cnt = 0 +    else: +        cnt = (a + cnt) % 2