eolymp
bolt
Try our new interface for solving problems
Problems

How many different?

How many different?

For the given set of n integers a1, . . ., an find the number of different numbers, representing the sum of the elements of nonempty subsets of a given set. In other words, determine the power of the set of sums of elements of all kinds of nonempty subsets of a given set.

Input

First line contains number n. Second line contains numbers a1, ..., an (1n20, -105ai105).

Output

Print the power of the set of sums of elements.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
99999
Output example #1
1
Input example #2
3
2 4 6
Output example #2
6
Source III International Summer School Programming in Sevastopol 2012