3 // 추의 개수
1 5 7 // 각각의 추의 무게
import sys
sys.stdin = open("./input/in3.txt", "rt")
def DFS(L,sum): # L은 각각의 추들 [1,5,7] # sum은 측정할 수 있는 물의 무게
global res
if L==n:
if 0<sum<=s: # sum이 양수일 때 (음수이면 대칭이 나올거니까 무시)
res.add(sum)
else:
DFS(L+1,sum+weight[L]) # 추를 저울의 왼쪽에 놓는 경우
DFS(L+1,sum-weight[L]) # 추를 저울의 오른쪽에 놓는 경우
DFS(L+1, sum) # 추를 사용하지 않는 경우
if __name__=="__main__":
n=int(input())
weight=list(map(int,input().split())) # 추 리스트
s = sum(weight) # 추 무게의 총 합
res=set() # 측정될 수 있는 물의 무게 - 중복을 제거하기 위해 set 사용
DFS(0,0)
print(s - len(res)) # set 자료구조의 길이는 len() 이용