- Time limit: 1.00 s
- Memory limit: 512 MB
You have coins with positive integer values. What is the smallest sum you cannot create using a subset of the coins?
Input
The first input line has an integer : the number of coins.
The second line has integers : the value of each coin.
Output
Print one integer: the smallest coin sum.
Constraints
Example
Input:
5 2 9 1 2 7
Output:
6