#ABC473C. 转班 / Change Schools

转班 / Change Schools

Problem Statement

Currently, AtCoder High School has KK classes and NN students, and the ii-th (1iN)(1\le i\le N) student belongs to the AiA_i-th class.

Takahashi is transferring to AtCoder High School in September. At that time, he can choose any one class among the KK classes and belong to that class.

He will be sad if there is a class with more students belonging to it than the class he belongs to. Otherwise, he will be happy.

Find how many classes make him happy if he belongs to them.

Constraints

  • 1N2×1051\le N\le 2\times 10^5
  • 1KN1\le K\le N
  • 1AiK (1iN)1\le A_i\le K\ (1\le i\le N)
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

  • NN KK
  • A1A_1 A2A_2 \ldots ANA_N

Output

Output the number of classes satisfying the condition.

8 5
3 3 5 5 4 4 3 2
3

For example, if Takahashi chooses the fifth class and belongs to it, the number of students belonging to the fifth class becomes 33. Then, he will be happy since there is no class with more than three students belonging to it.

On the other hand, for example, if he chooses the first class and belongs to it, the number of students belonging to the first class becomes 11. Then, he will be sad since three students belong to the third class.

He will be happy if and only if he chooses the third, fourth, or fifth class, so output 3.

6 1
1 1 1 1 1 1
1

It is possible that AtCoder High School has only one class.

14 8
6 1 5 3 8 4 3 4 3 5 1 2 5 1
4