class Program { static void Main(string[] args) { int[] nk = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num)); int[] pinList = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num)); for(int i = 0; i < pinList.Length; i++) { if (pinList[i] == 0) { continue; } for (int j = i+1;j < pinList.Length; j++) { if (pinList[j] - pinList[i] >= nk[1]) { break; } pinList[j] = 0; } } Console.WriteLine(PinCount(pinList)); } private static int PinCount(int[] pinList) { int count = 0; foreach (int pin in pinList) { if(pin != 0) { count++; } } return count; } }