PivotOJ

H-Index

시간 제한: 1000ms메모리 제한: 512MB출처: ICPC Rocky Mountain Regional 2018BOJ 22282

문제

In research, it is tough to determine how good of a researcher you are. One way that people determine how good you are is by looking at your HH-Index.

Each paper has a certain number of citations. Your HH-Index is the largest number HH such that you have HH papers with at least HH citations. Given the number of citations on each paper you have written, what is your HH-Index?

입력

The first line of input contains a single integer nn (1n1000001 \leq n \leq 100\,000), which is the number of papers you have written.

The next nn lines describe the papers. Each of these lines contains a single integer cc (0c10000000000 \leq c \leq 1\,000\,000\,000), which is the number of citations that this paper has.

출력

Display your HH-Index.

예제

예제 1

입력
5
7
1
2
1
5
출력
2

예제 2

입력
5
7
1
3
1
5
출력
3

예제 3

입력
3
4
2
3
출력
2
코드를 제출하려면 로그인하세요.