import java.util.*;

public class Main {
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        int[] nums = new int[n];
        for(int i = 0; i < n; i++)
            nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int currD = 0;
        int ans = 0;
        for(int i = 1; i < n; i++)
        {
            currD += (nums[i] - nums[i - 1]);
            
            if(currD > d)
            {
                currD -= (nums[i] - nums[i - 1]);
                ans++;
            }
        }
        System.out.println(ans);
    }
}