A researcher has n papers, paper i with c[i] citations. Define the researcher's impact threshold as the largest whole number h such that at least h of the papers each have at least h citations.
Report that threshold h.
Input format
Line 1: an integer n.
Line 2: n space-separated non-negative integers, the citation counts.
Output format
A single integer: the largest h such that at least h papers have at least h citations each.
Constraints
- 1 <= n <= 40
- 0 <= each citation count <= 1000000000