n=int(eval(input()))

ab = []

for _ in range(n):

    a=int(eval(input()))

    ab.append(a)



ans = 0



for i in range(n):

    ans += ab[i]//2

    if i == n-1:

        break

    elif ab[i]%2 == 1 and ab[i+1] > 0:

        ans += 1

        ab[i+1] -= 1

print(ans)
N = int(eval(input()))

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



ans = 0

for key,val in enumerate(A):

    ans += int(val/2)



    if key < N-1 and int(val/2)*2 != val and A[key+1] != 0:

        A[key+1] -= 1

        ans += 1

print(ans)
n = int(eval(input()))
ab = []
for _ in range(n):
    a = int(eval(input()))
    ab.append(a)
ans = 0
for i in range(n):
    ans += ab[i] // 2
    if i == n - 1:
        break
    elif ab[i] % 2 == 1 and ab[i + 1] > 0:
        ans += 1
        ab[i + 1] -= 1
print(ans)

N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
ans = 0
for key, val in enumerate(A):
    ans += int(val / 2)
    if key < N - 1 and int(val / 2) * 2 != val and A[key + 1] != 0:
        A[key + 1] -= 1
        ans += 1
print(ans)

-n = int(eval(input())) -ab = [] -for _ in range(n): -    a = int(eval(input())) -    ab.append(a) +N = int(eval(input())) +A = [int(eval(input())) for _ in range(N)] -for i in range(n): -    ans += ab[i] // 2 -    if i == n - 1: -        break -    elif ab[i] % 2 == 1 and ab[i + 1] > 0: +for key, val in enumerate(A): +    ans += int(val / 2) +    if key < N - 1 and int(val / 2) * 2 != val and A[key + 1] != 0: +        A[key + 1] -= 1 -        ab[i + 1] -= 1