from sys import stdin
from itertools import accumulate
arr=[int(x) for x in stdin.readline().split()]
n = arr.pop(0)
arr2 = arr[::-1]
arr = set(accumulate(arr))
arr2 = set(accumulate(arr2))
print(len(arr & arr2))