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

import java.io.IOException;
import java.io.InputStream;

public class Main {

    static int readInt(InputStream in) throws IOException {
        int result = 0;

        boolean isDigit = false;

        for (int cur = 0; (cur = in.read()) != -1; ) {
            if (cur >= '0' && cur <= '9') {
                isDigit = true;
                result = result * 10 + (cur - '0');
            } else {
                if (isDigit) break;
            }
        }

        return result;
    }

    static void sort(int[] arr) {
        sort(arr, 0, arr.length - 1);
    }

    static void sort(int[] arr, int start, int end) {
        if (start == end) return;
        int mid = (start + end) / 2;
        sort(arr, start, mid);
        sort(arr, mid + 1, end);
        merge(arr, start, mid, end);
    }

    static void merge(int[] arr, int start, int mid, int end) {
        int[] first = new int[mid - start + 1];
        int[] second = new int[end - mid];

        for (int i = start; i <= mid; i++) {
            first[i - start] = arr[i];
        }
        for (int i = mid + 1; i <= end; i++) {
            second[i - mid - 1] = arr[i];
        }

        int i = 0;
        int j = 0;
        int k = start;

        while (i < first.length && j < second.length) {
            if (first[i] <= second[j]) {
                arr[k] = first[i];
                i++;
            } else {
                arr[k] = second[j];
                j++;
            }
            k++;
        }

        while (i < first.length) {
            arr[k] = first[i];
            i++;
            k++;
        }

        while (j < second.length) {
            arr[k] = second[j];
            j++;
            k++;
        }

    }

    public static void main(String[] args) throws IOException {
        InputStream in = System.in;

        int n = readInt(in);
        int K = readInt(in);

        int[] sizes = new int[n];
        for (int i = 0; i < n; i++) {
            sizes[i] = readInt(in);
        }

        sort(sizes);

        int left = n;
        int groupStart = 0;
        int prevSize = sizes[0];

        for (int i = 1; i < n; i++) {
            int cur = sizes[i];
            int delta = cur - prevSize;
            prevSize = cur;
            if (delta == 0) {
                //group++;
                continue;
            }
            if (delta > K) {
                groupStart = i;
                continue;
            }
//            left -= group;
            left -= (i - groupStart);
            groupStart = i;
        }


        System.out.println(left);
    }
}