from copy import deepcopy as dp
N = int(input())
A = list(map(int, input().split()))
An = dp(A)
n = len(A)
n2 = n
c = 0
for _ in range(n2-1):
    n -= 1
    for j in range(n):
        An[j] += A[n2-n+j] 
    del An[-1]
    c += An.count(0)
    print(An)
print(c)