# AGC003B - Simplified mahjong

import sys

input = sys.stdin.readline



def main():

    N = int(eval(input()))

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

    ans = 0

    for i in range(N):  # make pairs greedily

        ans += A[i] // 2  # pairs with same cards

        if A[i] % 2 and A[i + 1]:  # pairs with a neighbor

            ans += 1

            A[i + 1] -= 1

    print(ans)





if __name__ == "__main__":

    main()
# AGC003B - Simplified mahjong

import sys

input = sys.stdin.readline



def main():

    # split in subsequences when 0 appears -> sum up cur // 2

    N = int(eval(input()))

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

    ans, cur = 0, 0

    for i in A:

        if i:

            cur += i

        else:

            ans += cur // 2

            cur = 0

    print(ans)





if __name__ == "__main__":

    main()
# AGC003B - Simplified mahjong
import sys

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = list(map(int, [eval(input()) for _ in range(N)])) + [0]
    ans = 0
    for i in range(N):  # make pairs greedily
        ans += A[i] // 2  # pairs with same cards
        if A[i] % 2 and A[i + 1]:  # pairs with a neighbor
            ans += 1
            A[i + 1] -= 1
    print(ans)


if __name__ == "__main__":
    main()

# AGC003B - Simplified mahjong
import sys

input = sys.stdin.readline


def main():
    # split in subsequences when 0 appears -> sum up cur // 2
    N = int(eval(input()))
    A = list(map(int, [eval(input()) for _ in range(N)])) + [0]
    ans, cur = 0, 0
    for i in A:
        if i:
            cur += i
        else:
            ans += cur // 2
            cur = 0
    print(ans)


if __name__ == "__main__":
    main()

+    # split in subsequences when 0 appears -> sum up cur // 2 -    ans = 0 -    for i in range(N):  # make pairs greedily -        ans += A[i] // 2  # pairs with same cards -        if A[i] % 2 and A[i + 1]:  # pairs with a neighbor -            ans += 1 -            A[i + 1] -= 1 +    ans, cur = 0, 0 +    for i in A: +        if i: +            cur += i +        else: +            ans += cur // 2 +            cur = 0