4. CycloForces
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Elephant Semyon is a member of the sports club "CycloForces". In this club, all participants are assigned levels. To achieve level $$$K$$$, one must participate in at least $$$K$$$ races, each at least $$$K$$$ kilometers long. The level increases whenever possible.

Elephant Semyon remembers the distances of all his races. Help him determine his level.

Input

The first line of the input contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the number of races.

Each of the following $$$n$$$ lines contains a single integer $$$a_i$$$ ($$$1 \le a_i \le 10^9$$$) — the length of the next race.

Output

Output a single integer — the rating of Elephant Semyon.

Scoring

Solutions that work correctly for $$$n \le 15$$$ will be scored 20 points.

Solutions that work correctly for $$$n \le 1000$$$ will be scored 50 points.

Solutions that work correctly for $$$a_i \le 10^5$$$ will be scored 80 points.

Example
Input
5
3
1
4
1
5
Output
3
Note

In the example, Elephant Semyon completed $$$5$$$ races. Among them, there are $$$3$$$ races with a distance of at least $$$3$$$ kilometers each (these are the races of $$$3$$$, $$$4$$$, and $$$5$$$ km), so Elephant Semyon's level can be $$$3$$$. It can be shown that he has not yet reached the next level.