You have a button that gives you a candy when you press it. However, you can only get a candy if a certain amount of time has passed since you last got one. You will press the button multiple times, and you need to count how many candies you receive.
Input: 6 5
1 3 7 8 10 12
Output: 3
Input: 3 2
0 2 4
Output: 3