Huseyn wants to train before another programming competition. During the first day of his training he should solve exactly problem, during the second day — exactly problems, during the third day — exactly problems, and so on. During the -th day he should solve problems.
Huseyn has a list of contests, the -th contest consists of problems. During each day Huseyn has to choose exactly one of the contests he didn't solve yet and solve it. He solves exactly problems from this contest. Other problems are discarded from it. If there are no contests consisting of at least problems that Huseyn didn't solve yet during the -th day, then Huseyn stops his training.
How many days Huseyn can train if he chooses the contests optimally?
The first line contains one integer — the number of contests.
The second line contains integers — the number of problems in the -th contest.
Print one integer — the maximum number of days Huseyn can train if he chooses the contests optimally.