import itertools
N = int(input())
A = list(map(int,input().split()))
d = 0
for i in range(N):
	for j in itertools.combinations(A, i+1):
		c = 0
		for k in j:
			c = c + k
		if c == 0:
			d = d + 1
print(d)