import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        InputReader in = new InputReader();
        int n = in.nextInt();
        int d = in.nextInt();
        int[] nums = new int[101];

        for(int i = 0; i < n; ++i) {
            nums[in.nextInt()]++;
        }

        int min = 0;
        for(int i = 0; i <= 100; ++i) {
            if(nums[i] != 0) {
                min = i;
                break;
            }
        }

        int remove = 0;
        for(int i = min + d + 1; i <= 100; ++i) {
            remove += nums[i];
        }

        System.out.println(remove);
    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    InputReader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) { 
                e.printStackTrace();
            }
        }
        return tokenizer.nextToken();
    }

    int nextInt() { 
        return Integer.parseInt(next());
    }

    long nextLong() { 
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() { 
        String s = "";
        try { 
            s = reader.readLine();
        } catch (IOException e) { 
            e.printStackTrace();
        }
        return s; 
    }
}

