def slove():

    import sys

    input = sys.stdin.readline

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

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

    t = 0

    cnt = 0

    for a in A:

        t += a

        if a == 0:

            cnt += (t // 2)

            t = 0

    cnt += (t // 2)

    print(cnt)





if __name__ == '__main__':

    slove()

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()

def slove():
    import sys

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


if __name__ == "__main__":
    slove()

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()

-    N = int(input().rstrip("\n")) -    A = [int(input().rstrip("\n")) for _ in range(N)] +    n = int(input().rstrip("\n")) +    a = [int(input().rstrip("\n")) for _ in range(n)] +    cnt = 0 -    cnt = 0 -    for a in A: -        t += a -        if a == 0: +    for v in a: +        if v == 0: +        else: +            t += v