N = int(input())
A = list(map(int, input().split()))

sum_list = [None] * (N+1)

sum_list[0] = 0
for i in range(N):
    sum_list[i+1] = sum_list[i] + A[i]

output = 0
for i in range(N+1):
    for j in range(i+1, N+1):
        if sum_list[j] - sum_list[i] == 0:
            print("(", str(i), ",", str(j), ")")
            output += 1

print(output)