def slove():

    import sys

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

    a = [int(input().rstrip('\n')) for _ in range(n)]

    cnt = 0

    t = 0

    for v in a:

        if v == 0:

            cnt += (t // 2)

            t = 0

        else:

            t += v

    cnt += (t // 2)

    print(cnt)





if __name__ == '__main__':

    slove()

import sys





def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

    n = int(readline())

    a = [int(readline()) for _ in range(n)]

    c = ac = 0

    for v in a:

        c += v

        if v == 0:

            ac += c // 2

            c = 0

    print((ac + c // 2))





if __name__ == '__main__':

    solve()

def slove():
    import sys

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    a = [int(input().rstrip("\n")) for _ in range(n)]
    cnt = 0
    t = 0
    for v in a:
        if v == 0:
            cnt += t // 2
            t = 0
        else:
            t += v
    cnt += t // 2
    print(cnt)


if __name__ == "__main__":
    slove()

import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    n = int(readline())
    a = [int(readline()) for _ in range(n)]
    c = ac = 0
    for v in a:
        c += v
        if v == 0:
            ac += c // 2
            c = 0
    print((ac + c // 2))


if __name__ == "__main__":
    solve()

-def slove(): -    import sys +import sys -    input = sys.stdin.readline -    n = int(input().rstrip("\n")) -    a = [int(input().rstrip("\n")) for _ in range(n)] -    cnt = 0 -    t = 0 + +def solve(): +    readline = sys.stdin.buffer.readline +    mod = 10**9 + 7 +    n = int(readline()) +    a = [int(readline()) for _ in range(n)] +    c = ac = 0 +        c += v -            cnt += t // 2 -            t = 0 -        else: -            t += v -    cnt += t // 2 -    print(cnt) +            ac += c // 2 +            c = 0 +    print((ac + c // 2)) -    slove() +    solve()