using System;
using System.Collections.Generic;

namespace ABLD
{
    class Program
    {
        static void Main(string[] args)
        {
            var NK = Console.ReadLine().Split(' ');
            var N = int.Parse(NK[0]);
            var K = int.Parse(NK[1]);
            var A = new List<int>();
            for(var i = 0; i < N; i++)
            {
                A.Add(int.Parse(Console.ReadLine()));
            }

            var answer = 1;
            for(var i = 0; i < A.Count;)
            {
                var breaked = false;
                for(var j = i + 1; j < A.Count; j++)
                {
                    var ai = A[i];
                    var aj = A[j];
                    if (Math.Abs(aj - ai) <= K)
                    {
                        answer++;
                        i = j;
                        breaked = true;
                        break;   
                    }
                }
                if (!breaked)
                {
                    i++;
                }
            }

            Console.WriteLine(answer);
        }
    }
}
