n = int(input())
A = list(map(int, input().split()))
ans = 0
m = A[0]
for i in range(1,n):
  m += A[i]
  k = m
  for j in range(i):
    k -= A[j]
    if k == 0:
      ans += 1
  if m == 0:
    ans += 1
print(ans)