No Change

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Jack has $N$ coins, with values $M_1$, $M_2$, \dots, $M_N$. Find the smallest positive amount that cannot be paid with these coins with no change.

입력

The first line contains $N$ ($1 \le N \le 1\,000$), the number of coins. The second line contains $N$ integers $M_i$ ($1 \le M_i \le 1\,000\,000$), the values of the coins.

출력

The only line should contain a single positive integer: the smallest amount that Jack cannot pay with his coins.