import sys

input = sys.stdin.readline





def main():

    N = int(eval(input()))

    carry = 0

    ans = 0

    for i in range(N):

        x = int(eval(input()))

        if carry and x > 0:

            ans += 1  # carry を優先して処理

            d, m = divmod(x - 1, 2)

            ans += d

            carry = m

        else:

            d, m = divmod(x, 2)

            ans += d

            carry = m

    print(ans)





if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline





# 解説AC

def main():

    N = int(eval(input()))

    ans = 0

    x = 0

    for i in range(N):

        a = int(eval(input()))

        if a == 0:

            ans += x//2

            x = 0

        else:

            x += a

    ans += x//2

    print(ans)





if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    carry = 0
    ans = 0
    for i in range(N):
        x = int(eval(input()))
        if carry and x > 0:
            ans += 1  # carry を優先して処理
            d, m = divmod(x - 1, 2)
            ans += d
            carry = m
        else:
            d, m = divmod(x, 2)
            ans += d
            carry = m
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline
# 解説AC
def main():
    N = int(eval(input()))
    ans = 0
    x = 0
    for i in range(N):
        a = int(eval(input()))
        if a == 0:
            ans += x // 2
            x = 0
        else:
            x += a
    ans += x // 2
    print(ans)


if __name__ == "__main__":
    main()

- - +# 解説AC -    carry = 0 +    x = 0 -        x = int(eval(input())) -        if carry and x > 0: -            ans += 1  # carry を優先して処理 -            d, m = divmod(x - 1, 2) -            ans += d -            carry = m +        a = int(eval(input())) +        if a == 0: +            ans += x // 2 +            x = 0 -            d, m = divmod(x, 2) -            ans += d -            carry = m +            x += a +    ans += x // 2