eolymp
Competitions

АСМ for students of Georgian Technical University

The smallest unimaginable

For a givenset consisting ofpositive integers, determine thesmallest positive number,unimaginableas the sum ofthe elementsof anysubsetof theset.

Input

The input filecontainsall the numbersthat make upa given set.Each of themdoes not exceed1015, the totalamountdoes not exceed10000,and their sumis guaranteed tonot exceed264-1.

Output

In the outputfileto bringa single number- the answerof the problem.

Time limit 1 second
Memory limit 64 MiB
Input example #1
1 7 2 5 423456
Output example #1
4