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