For kefir!
The Yulya Indians cherish their ancestral traditions and their love for kefir. One such tradition involves gathering at the Main Temple every evening to receive their Evening Kefir.
Over time, the Indians have perfected the art of queuing for kefir, ensuring they receive it in the exact order they arrive at the Main Temple. However, Kolgattsi, an Indian who often arrives late, typically ends up at the back of the queue. Not wanting to be the last to receive his kefir, Kolgattsi aims to move as close to the front as possible. To achieve this, he must convince some of the Indians ahead of him to let him pass. If certain Indians refuse, Kolgattsi can still move forward in the queue with these individuals.
Having lived among his tribe for a long time, Kolgattsi knows how many people each Indian in the queue is willing to let pass. With this knowledge and the current order of the queue, Kolgattsi wants to determine how close he can get to the front. Can you help him figure this out?
Input
The first line contains the number of Indians n (1 ≤ n ≤ 100000) in the queue. The second line contains n integers a[i]
(0 ≤ a[i]
≤ n), where each a[i]
represents the number of Indians the Indian standing in the i-th position from the start of the queue is willing to let pass.
Output
Print the earliest position in the queue that Kolgattsi can occupy.