from collections import OrderedDict, deque

N = int(eval(input()))

A = OrderedDict({i: int(eval(input())) for i in range(1, N+1)})

ans = 0



for key in range(1, N):

    ans += A[key] // 2

    A[key] %= 2

    if (A[key] == 1) & (A[key+1] > 0):

        ans += 1

        A[key+1] -= 1





print((ans + A[N]//2))
N = int(eval(input()))

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



ans = 0

for i in range(N-1):

    ans += A[i] // 2

    if A[i] % 2 and A[i+1]:

        ans += 1

        A[i+1] -= 1



print((ans + A[-1]//2))
from collections import OrderedDict, deque

N = int(eval(input()))
A = OrderedDict({i: int(eval(input())) for i in range(1, N + 1)})
ans = 0
for key in range(1, N):
    ans += A[key] // 2
    A[key] %= 2
    if (A[key] == 1) & (A[key + 1] > 0):
        ans += 1
        A[key + 1] -= 1
print((ans + A[N] // 2))

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

-from collections import OrderedDict, deque - -A = OrderedDict({i: int(eval(input())) for i in range(1, N + 1)}) +A = [int(eval(input())) for i in range(N)] -for key in range(1, N): -    ans += A[key] // 2 -    A[key] %= 2 -    if (A[key] == 1) & (A[key + 1] > 0): +for i in range(N - 1): +    ans += A[i] // 2 +    if A[i] % 2 and A[i + 1]: -        A[key + 1] -= 1 -print((ans + A[N] // 2)) +        A[i + 1] -= 1 +print((ans + A[-1] // 2))