CCC has just finished, and the organizer is trying to choose contestants to put on the honour roll. If someone who gets a score of
is on the honour roll, then to keep the competition fair, every contestant who gets a score greater or equal to
should also be on the honour roll. Write a program to determine the maximum number of people who will be on the honour roll so that the number is not greater than
.
Input Specification
The first line contains and
(
), indicating the total number of contestants and the expected number of people on the honour roll, respectively.
The next line contains space-separated integers
(
), representing the score of
-th contestant.
Output Specification
Output one integer denotes the maximum number of people on the honour roll to keep competition fair and not greater than .
Sample Input 1
5 2
1 2 3 3 4
Sample Output 1
1
Explanation
The organizer cannot only put contestants on the honour roll. The optimal way is to only put the contestant who scored
on the honour roll.
Sample Input 2
5 3
2 2 2 2 4
Sample Output 2
1
Sample Input 3
8 5
1 1 2 2 3 3 3 3
Sample Output 3
4
Comments