Time Limit : sec, Memory Limit : KB
English / Japanese  

Programming Contest

The programming contest will be held at Byakko University. There will be several problems in the contest, each assigned a score based on its difficulty level.

The organizing committee decided to calculate each team's score based on the following rules, taking into account both the number of problems solved and their scores.

“The largest A such that satisfies the requirement that there be at least A problems answered correctly by a team with a score of A or higher is the score for that team.”

Write a program that calculates a team's score based on the number of problems a team answered correctly and the scores for those problems .

Input

Input is given in the following format.

N
p1 p2 ... pN

The first line gives the number of problems the team answered correctly N (1 ≤ N ≤ 100). In the second line, score of each problems answered correctly p i (1 ≤ p i ≤ 100) are given.

Output

Output the score in a line.

Sample Input 1

7
5 4 3 10 2 4 1

Sample Output 1

4

Since the team answered at least four problems correctly with a score of 4 or higher, the team score is 4.


Sample Input 2

3
1 1 100

Sample Output 2

1

Since the team answered at least one problems correctly with a score of 1 or higher, the team score is 1.


Sample Input 3

4
11 15 58 1

Sample Output 3

3

Since the team answered at least three problems correctly with a score of 3 or higher, the team score is 3.