L1 = int(input())
L2 = list(map(int,input().split(" ")))
L3 = [None]*(L1)
A = 0

def summing(length):
    s = 0
    for i in range(length):
        s += L2[i]
    return s

for i in range(L1):
    L3[i] = summing(i+1)

for i in range(L1):
    print(L3)
    for j in range(len(L3)):
        if i <= j and L3[j] == 0:
            A += 1
        L3[j] -= L2[i]

print(A)