from collections import defaultdict



def main():

    N = int(eval(input()))

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



    ans = 0

    for i in range(N):

        ans += A[i] // 2

        if A[i] % 2 == 1:

            if A[i+1] >= 1:

                ans += 1

                A[i+1] -= 1



    print(ans)







    

    





if __name__ == "__main__":

    main()
def main():

    N = int(eval(input()))

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

    cnt = 0

    for i in range(N):

        if i == N-1:

            cnt += A[i] // 2

            break

        cnt += A[i] // 2

        mod = A[i] % 2

        if A[i+1] >= mod:

            cnt += mod

            A[i+1] -= mod



    print(cnt)







if __name__ == "__main__":

    main()
from collections import defaultdict


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


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    A = list(int(eval(input())) for _ in range(N))
    cnt = 0
    for i in range(N):
        if i == N - 1:
            cnt += A[i] // 2
            break
        cnt += A[i] // 2
        mod = A[i] % 2
        if A[i + 1] >= mod:
            cnt += mod
            A[i + 1] -= mod
    print(cnt)


if __name__ == "__main__":
    main()

-from collections import defaultdict - - -    A = [int(eval(input())) for _ in range(N)] + [0] -    ans = 0 +    A = list(int(eval(input())) for _ in range(N)) +    cnt = 0 -        ans += A[i] // 2 -        if A[i] % 2 == 1: -            if A[i + 1] >= 1: -                ans += 1 -                A[i + 1] -= 1 -    print(ans) +        if i == N - 1: +            cnt += A[i] // 2 +            break +        cnt += A[i] // 2 +        mod = A[i] % 2 +        if A[i + 1] >= mod: +            cnt += mod +            A[i + 1] -= mod +    print(cnt)