# coding:utf-8



INF = float('inf')





def inpl(): return list(map(int, input().split()))





N = int(eval(input()))

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



ans = 0

prev = 0

for i in range(N):

    if prev == 1 and A[i] > 0:

        A[i] -= 1

        ans += 1

    q, mod = divmod(A[i], 2)

    ans += q

    prev = mod



print(ans)
# coding:utf-8



import sys



INF = float('inf')

MOD = 10 ** 9 + 7



def LI(): return [int(x) for x in sys.stdin.readline().split()]

def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF(): return [float(x) for x in sys.stdin.readline().split()]

def LS(): return sys.stdin.readline().split()

def II(): return int(sys.stdin.readline())

def SI(): return eval(input())





def main():

    n = II()

    A = [II() for _ in range(n)]



    res = 0

    mod = 0

    for a in A:

        if not a:

            mod = 0

            continue

        q, mod = divmod(a + mod, 2)

        res += q



    return res





print((main()))

# coding:utf-8
INF = float("inf")


def inpl():
    return list(map(int, input().split()))


N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
ans = 0
prev = 0
for i in range(N):
    if prev == 1 and A[i] > 0:
        A[i] -= 1
        ans += 1
    q, mod = divmod(A[i], 2)
    ans += q
    prev = mod
print(ans)

# coding:utf-8
import sys

INF = float("inf")
MOD = 10**9 + 7


def LI():
    return [int(x) for x in sys.stdin.readline().split()]


def LI_():
    return [int(x) - 1 for x in sys.stdin.readline().split()]


def LF():
    return [float(x) for x in sys.stdin.readline().split()]


def LS():
    return sys.stdin.readline().split()


def II():
    return int(sys.stdin.readline())


def SI():
    return eval(input())


def main():
    n = II()
    A = [II() for _ in range(n)]
    res = 0
    mod = 0
    for a in A:
        if not a:
            mod = 0
            continue
        q, mod = divmod(a + mod, 2)
        res += q
    return res


print((main()))

+import sys + +MOD = 10**9 + 7 -def inpl(): -    return list(map(int, input().split())) +def LI(): +    return [int(x) for x in sys.stdin.readline().split()] -N = int(eval(input())) -A = [int(eval(input())) for _ in range(N)] -ans = 0 -prev = 0 -for i in range(N): -    if prev == 1 and A[i] > 0: -        A[i] -= 1 -        ans += 1 -    q, mod = divmod(A[i], 2) -    ans += q -    prev = mod -print(ans) +def LI_(): +    return [int(x) - 1 for x in sys.stdin.readline().split()] + + +def LF(): +    return [float(x) for x in sys.stdin.readline().split()] + + +def LS(): +    return sys.stdin.readline().split() + + +def II(): +    return int(sys.stdin.readline()) + + +def SI(): +    return eval(input()) + + +def main(): +    n = II() +    A = [II() for _ in range(n)] +    res = 0 +    mod = 0 +    for a in A: +        if not a: +            mod = 0 +            continue +        q, mod = divmod(a + mod, 2) +        res += q +    return res + + +print((main()))