n = int(eval(input()))

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



ans = A[0] // 2

A[0] %= 2



for i in range(1, n):

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

    if A[i] == 0:

        pass

    elif A[i-1] == 1:

        if A[i] % 2 == 0:

            A[i] = 1

        else:

            A[i] = 0

    else:

        A[i] %= 2



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

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



ans = 0

s = 0



for a in A:

  s += a

  

  if a == 0:

    ans += s//2

    s = 0



print((ans + s//2))
n = int(eval(input()))
A = [int(eval(input())) for i in range(n)]
ans = A[0] // 2
A[0] %= 2
for i in range(1, n):
    ans += (A[i - 1] + A[i]) // 2
    if A[i] == 0:
        pass
    elif A[i - 1] == 1:
        if A[i] % 2 == 0:
            A[i] = 1
        else:
            A[i] = 0
    else:
        A[i] %= 2
print(ans)

n = int(eval(input()))
A = [int(eval(input())) for i in range(n)]
ans = 0
s = 0
for a in A:
    s += a
    if a == 0:
        ans += s // 2
        s = 0
print((ans + s // 2))

-ans = A[0] // 2 -A[0] %= 2 -for i in range(1, n): -    ans += (A[i - 1] + A[i]) // 2 -    if A[i] == 0: -        pass -    elif A[i - 1] == 1: -        if A[i] % 2 == 0: -            A[i] = 1 -        else: -            A[i] = 0 -    else: -        A[i] %= 2 -print(ans) +ans = 0 +s = 0 +for a in A: +    s += a +    if a == 0: +        ans += s // 2 +        s = 0 +print((ans + s // 2))