def solve():

    N = int(eval(input()))

    A = [int(eval(input())) for _ in range(N)]

    ans = 0

    for a in A:

        ans += a//2

    prev = 0

    for a in A:

        new = a%2

        if prev == 1:

            if new == 1:

                ans += 1

            elif a>0:

                prev = 1

            else:

                prev = 0

        prev = prev^new

    return ans

print((solve()))
def solve():

  ans = 0

  N = int(eval(input()))

  A = [int(eval(input())) for _ in range(N)]

  rem = 0

  for i in range(N):

    ans += (A[i]+rem)//2

    if A[i]>0:

      rem = (A[i]+rem)%2

    else:

      rem = 0

  return ans

print((solve()))
def solve():
    N = int(eval(input()))
    A = [int(eval(input())) for _ in range(N)]
    ans = 0
    for a in A:
        ans += a // 2
    prev = 0
    for a in A:
        new = a % 2
        if prev == 1:
            if new == 1:
                ans += 1
            elif a > 0:
                prev = 1
            else:
                prev = 0
        prev = prev ^ new
    return ans


print((solve()))

def solve():
    ans = 0
    N = int(eval(input()))
    A = [int(eval(input())) for _ in range(N)]
    rem = 0
    for i in range(N):
        ans += (A[i] + rem) // 2
        if A[i] > 0:
            rem = (A[i] + rem) % 2
        else:
            rem = 0
    return ans


print((solve()))

+    ans = 0 -    ans = 0 -    for a in A: -        ans += a // 2 -    prev = 0 -    for a in A: -        new = a % 2 -        if prev == 1: -            if new == 1: -                ans += 1 -            elif a > 0: -                prev = 1 -            else: -                prev = 0 -        prev = prev ^ new +    rem = 0 +    for i in range(N): +        ans += (A[i] + rem) // 2 +        if A[i] > 0: +            rem = (A[i] + rem) % 2 +        else: +            rem = 0