시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 7 5 5 71.429%

문제

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 $H$-Index.

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

입력

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

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

출력

Display your $H$-Index.

예제 입력 1

5
7
1
2
1
5

예제 출력 1

2

예제 입력 2

5
7
1
3
1
5

예제 출력 2

3

예제 입력 3

3
4
2
3

예제 출력 3

2