using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace atcoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var buffer = Console.ReadLine().Split();
            var N = int.Parse(buffer[0]);
            var K = int.Parse(buffer[1]);
            var list = new List<int>();
            for (int i = 0; i < N; i++)
                list.Add(int.Parse(Console.ReadLine()));

            var tmp = new List<List<int>>();
            for (int i = 0; i < N; i++)
            {
                tmp.Add(new List<int>());
                for (int j = i + 1; j < N; j++)
                    tmp[i].Add(Math.Abs(list[i] - list[j]));
            }

            var ans = 1;
            for (int i = 0; i < N; i++)
            {
                var up = 0;
                for (int j = 0; j < tmp[i].Count; j++)
                {
                    if (tmp[i][j] <= K)
                    {
                        ans++;
                        break;
                    }
                    up++;
                }
                i += up;
            }

            Console.WriteLine(ans);
        }
    }
}
