An audit ledger lists n transaction codes already sorted in non-decreasing order. Retention policy keeps at most K copies of any single code; extra copies beyond the first K of each value are discarded. Report how many codes remain after trimming.
Input format
Line 1: two integers n and K.
Line 2: n space-separated integers in non-decreasing order.
Output format
A single integer: the number of codes kept when each distinct value is capped at K copies.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ K ≤ 100000 (K may exceed the number of copies of a value)
- The values are given in non-decreasing order.
- -1000000000 ≤ each value ≤ 1000000000