IntermediateRating 1200
h-index
A researcher's h-index is the largest h such that h papers have at least h citations each. Print it.
Input
n, then n citation counts.
Output
A number.
Sample 1
Input
5 3 0 6 1 5
Output
3
Sample 2
Input
3 1 3 1
Output
1
Output appears here