from itertools import accumulate
n=int(input())
A=list(map(int,input().split()))
A=list(accumulate(A))
A=[0]+A
ans=[]
for i in range(n):
  for j in range(i+1,n+1):
    ans.append(A[i]-A[j])
print(ans.count(0))
  