Amounts
Very easy
Execution time limit is 2 seconds
Runtime memory usage limit is 64 megabytes
Given n integers a_1, a_2, ..., a_n. Find the number of different values of the sums of the form k_1a_1 + k_2a_2 + ... + k_na_n.
Input
The first line contains the number n (1 ≤ n ≤ 500), the second - the numbers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 100). It is known that 0 ≤ k_i ≤ 1 and all numbers are integers.
Output
Print the number of different values of the sums.
Examples
Input #1
Answer #1
Submissions 581
Acceptance rate 43%