import itertools

n = int(input())
a = map(int,input().split())
ans = 0
for i in range(2,n+1):
    c = list(itertools.combinations(a,i));
    for i in c:
        if sum(i) == 0:
            ans += 1
print(ans)
