The $h$-index of an author is the largest $h$ where he has at least $h$ papers with citations not less than $h$.
Bobo has published many papers. Given $a_0, a_1, a_2, \dots, a_{n}$ which means Bobo has published $a_i$ papers with citations exactly $i$, find the $h$-index of Bobo.
输入解释
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains an integer $n$. The second line contains $(n+1)$ integers $a_0, a_1, \dots, a_n$.
输出解释
For each test case, print an integer which denotes the result.
## Constraint
* $1 \leq n \leq 2 \cdot 10^5$ * $0 \leq a_i \leq 10^9$ * The sum of $n$ does not exceed $250,000$.