n = int(eval(input()))

a = [0]

for _ in range(n):

    a.append(int(eval(input())))



ans = 0

for i in range(n):



    # (x,x)のペア

    ans += a[i] // 2

    a[i] -= a[i] // 2 * 2



    # (x,x+1)のペア

    ans += min(a[i], a[i + 1])

    a[i + 1] -= min(a[i], a[i + 1])



else:  # 最後にa[-1]でできるだけペアを作る

    ans += a[-1] // 2



print(ans)

import sys

input = sys.stdin.readline



N = int(eval(input()))

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



ans = 0

for i in range(N):

    # できるだけ左でペアを作る

    Lpair = A[i] // 2

    ans += Lpair

    A[i] -= 2 * Lpair



    if A[i] > 0 and A[i + 1] > 0:

        ans += 1

        A[i] -= 1

        A[i + 1] -= 1





print(ans)

n = int(eval(input()))
a = [0]
for _ in range(n):
    a.append(int(eval(input())))
ans = 0
for i in range(n):
    # (x,x)のペア
    ans += a[i] // 2
    a[i] -= a[i] // 2 * 2
    # (x,x+1)のペア
    ans += min(a[i], a[i + 1])
    a[i + 1] -= min(a[i], a[i + 1])
else:  # 最後にa[-1]でできるだけペアを作る
    ans += a[-1] // 2
print(ans)

import sys

input = sys.stdin.readline
N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)] + [0]
ans = 0
for i in range(N):
    # できるだけ左でペアを作る
    Lpair = A[i] // 2
    ans += Lpair
    A[i] -= 2 * Lpair
    if A[i] > 0 and A[i + 1] > 0:
        ans += 1
        A[i] -= 1
        A[i + 1] -= 1
print(ans)

-n = int(eval(input())) -a = [0] -for _ in range(n): -    a.append(int(eval(input()))) +import sys + +input = sys.stdin.readline +N = int(eval(input())) +A = [int(eval(input())) for _ in range(N)] + [0] -for i in range(n): -    # (x,x)のペア -    ans += a[i] // 2 -    a[i] -= a[i] // 2 * 2 -    # (x,x+1)のペア -    ans += min(a[i], a[i + 1]) -    a[i + 1] -= min(a[i], a[i + 1]) -else:  # 最後にa[-1]でできるだけペアを作る -    ans += a[-1] // 2 +for i in range(N): +    # できるだけ左でペアを作る +    Lpair = A[i] // 2 +    ans += Lpair +    A[i] -= 2 * Lpair +    if A[i] > 0 and A[i + 1] > 0: +        ans += 1 +        A[i] -= 1 +        A[i + 1] -= 1