# 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

def main():

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

    N, *A = list(map(int, open(0).read().split()))

    A.append(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():
    # 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
def main():
    # split in subsequences when 0 appears -> sum up cur // 2
    N, *A = list(map(int, open(0).read().split()))
    A.append(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()

-import sys - -input = sys.stdin.readline - - -    N = int(eval(input())) -    A = list(map(int, [eval(input()) for _ in range(N)])) + [0] +    N, *A = list(map(int, open(0).read().split())) +    A.append(0)