|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초||128 MB||14||7||6||66.667%|
Mirko is celebrating his birthday and wants to invite his friends to the cinema.
They all like going to the cinema in big groups. Everyone requests that besides Mirko and himself/herself the certain number of other Mirko's friends comes to the cinema with them.
Mirko doesn't have enough money to invite them all so he wants to invite minimal number of people. He must determine such minimal group that every person's request is satisfied and it consists of at least one person.
Help Mirko to write a program that computes that number.
In the first row there is an integer N, 2 ≤ N ≤ 10 000, number of friends.
In the next N rows there is one integer per row Zi, 1 ≤ Zi < N. That numbers represent requests of all Mirko’s friends, that is, minimal number of people they are willing to go to the cinema with.
In first and only row you should write minimal number of people Mirko can invite to the cinema.
2 1 1
3 1 2 1
5 3 4 3 3 3