#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = list(map(int, input().split()))
    T1 = [0]
    s = 0
    for i in range(N):
        s += A[i]
        T1.append(s)
    SUM = s
    T2 = [SUM]
    for i in range(N):
        s -= A[i]
        T2.append(s)

    c = 0
    for i in range(N + 1):
        for j in range(i + 1, N + 1):
            if SUM - T1[i] - T2[j] == 0:
                c += 1
    print(c)
    return 0


if __name__ == '__main__':
    main()
