2 1
1 1
 4 1
2 2 1 1
 10 1
2 6 3 4 2 4 4 3 2 1
 2 1
999152 999153
 8 1000000
1 1 5 1000000 1000000 2 2 2
 9 2
1 6 1 5 5 8 6 8 7
 15 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 1 4
8
 10 1
6 3 1 3 6 4 1 3 6 4
 10 1
1 2 3 5 6 8 10 11 9 4
 7 2
1 5 5 8 9 8 8
 2 1000000
1 1000000
 8 2
3 13 9 8 3 13 9 14
 1 1
1
 2 1
1 2

2
 2
 4
 1
 2
 4
 15
 1
 7
 2
 4
 1
 5
 1
 1

//package juneLong;

import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class A {

	
	public static void main(String[] args) {
	
		FastScanner s = new FastScanner();
		int ans = 0;
		int n = s.nextInt();
		int k = s.nextInt();
		
		int[] A = new int[n];
		int[] arr = new int[n+1];
		arr[n] = 10000000;
		for(int i=0;i<n;i++){
			arr[i] = s.nextInt();
		}
		Arrays.sort(arr,0,n);
	    
	    int p = 0, q = 0;
	    for(int i=0;i<n-1;i++)
	    {
	        while(p<n&&arr[p]==arr[i])
	            p++;
	        if(arr[i]+k<arr[p])
	        {
	            q++;
	        }
	    }
	    
	    	
	
		System.out.println(q);
	}
	  static  class FastScanner {
          
          private InputStream mIs;
          private byte[] buf = new byte[1024];
          private int curChar;
          private int numChars;
       
          public FastScanner() {
              this(System.in);
          }
       
          public FastScanner(InputStream is) {
              mIs = is;
          }
       
          public int read() {
              if (numChars == -1)
                  throw new InputMismatchException();
              if (curChar >= numChars) {
                  curChar = 0;
                  try {
                      numChars = mIs.read(buf);
                  } catch (IOException e) {
                      throw new InputMismatchException();
                  }
                  if (numChars <= 0)
                      return -1;
              }
              return buf[curChar++];
          }
       
          public String nextLine() {
              int c = read();
              while (isSpaceChar(c))
                  c = read();
              StringBuilder res = new StringBuilder();
              do {
                  res.appendCodePoint(c);
                  c = read();
              } while (!isEndOfLine(c));
              return res.toString();
          }
       
          public String nextString() {
              int c = read();
              while (isSpaceChar(c))
                  c = read();
              StringBuilder res = new StringBuilder();
              do {
                  res.appendCodePoint(c);
                  c = read();
              } while (!isSpaceChar(c));
              return res.toString();
          }
       
          public long nextLong() {
              int c = read();
              while (isSpaceChar(c))
                  c = read();
              int sgn = 1;
              if (c == '-') {
                  sgn = -1;
                  c = read();
              }
              long res = 0;
              do {
                  if (c < '0' || c > '9')
                      throw new InputMismatchException();
                  res *= 10;
                  res += c - '0';
                  c = read();
              } while (!isSpaceChar(c));
              return res * sgn;
          }
       
          public int nextInt() {
              int c = read();
              while (isSpaceChar(c))
                  c = read();
              int sgn = 1;
              if (c == '-') {
                  sgn = -1;
                  c = read();
              }
              int res = 0;
              do {
                  if (c < '0' || c > '9')
                      throw new InputMismatchException();
                  res *= 10;
                  res += c - '0';
                  c = read();
              } while (!isSpaceChar(c));
              return res * sgn;
          }
       
          public boolean isSpaceChar(int c) {
              return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
          }
       
          public boolean isEndOfLine(int c) {
              return c == '\n' || c == '\r' || c == -1;
          
          }   
       
      }
    
}
  
