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.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x) {
        // To boxed array
        Integer[] what = Arrays.stream( a ).boxed().toArray( Integer[]::new );
        //Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );
        return binarySearch(what, l ,r, x);
    }

    private static int binarySearch(Integer []a, int l, int r, int x){
        if (l >= r) return -(l+1);
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch2(long []a, int l, int r, long x){
        if (l >= r) {
            if (a.length == 1 && a[0] <= x) {
                return 0;
            }
            else if (l - 1 >= 0 && a[l-1] <= x) {
                return l - 1;
            }
            else if (l < a.length && a[l] <= x){
                return l;
            }
            else if(l + 1 < a.length && a[l+1] <= x) {
                return l+1;
            }
            else if (l >= a.length && a[a.length - 1] <= x) {
                return a.length - 1;
            }
            return -1;
        }
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch2(a, l, m, x);
        else if (a[m] < x)
            return nextSearch2(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nextSearch(List<Integer>a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a.get(m) > x)
            return nextSearch(a, l, m, x);
        else if (a.get(m) < x || (m < a.size() - 1 && a.get(m+1) == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareStringNumbers(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    private static int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static long gcd (long a, long b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static boolean next(int[]a){
        for(int i = a.length-1;i>0;i--){
            for(int j=i-1;j>=0;j--) {
                if (a[i] > a[j]) {
                    int t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                    Arrays.sort(a, j + 1, a.length);
                    return true;
                }
            }
        }
        return false;
    }

    private static class LolStack implements Cloneable {
        private Long a[];
        private int index = -1;
        private long sum = 0;
        public LolStack(){
            a = new Long[100];
        }
        public void push(long x) {
            if (a.length <= index + 1) {
                a = Arrays.copyOf(a, a.length + 20);
            }
            a[++index] = x;
            sum+=x;
        }
        public long pop() {
            sum-=a[index];
            return a[index--];
        }
        public boolean isEmpty(){
            return index < 0;
        }

        public long getSum() {
            return sum;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            LolStack t = (LolStack) super.clone();
            t.a = Arrays.copyOf(a, a.length);
            t.sum = sum;
            t.index = index;
            return t;
        }
    }

    private static class LolQueue {
        int a[];
        int m[];
        int maxSize;
        int top = -1;
        int lower = 0;
        boolean computed = false;
        public LolQueue(int maxSize){
            this.maxSize = maxSize;
            a = new int[maxSize];
            m = new int[maxSize];
        }
        public void push(int x){
            a[++top] = x;
            m[top] = x;
            computed = false;
        }
        public int pop() {
            return a[lower++];
        }
        public int min() {
            if (!computed) {
                for (int i = top - 1; i >= lower; i--) {
                    if (m[i + 1] < m[i]) {
                        m[i] = m[i + 1];
                    }
                }
                computed = true;
            }
            return m[lower];
        }
    }
    private static int indexOf(int a[], int x){
        for (int i = 0; i < a.length; i++) {
            if(a[i] == x) return i;
        }
        return -1;
    }
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //scanner = new FastScanner(new FileInputStream("input.txt"));
        //printer = new PrintWriter(new FileOutputStream("output.txt"));
        int n = scanner.nextInt(), K = scanner.nextInt();
        Integer a[] = new Integer[n];
        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }
        Arrays.sort(a);
        int ans = 0;
        for (int i = 0; i < n - 1; i++) {
            int j = i + 1;
            while (true) {
                if (j == n - 1) break;
                if (a[j] > a[i]) break;
                j++;
            }
            if(a[i] < a[j] && a[i] + K >= a[j])
                ans+=j-i;
            i = j - 1;
        }
        printer.println(n - ans);
        printer.close();
    }

    private static List<Integer> dfs(ArrayList<ArrayList<Integer>>a, boolean used[], int v) {
        used[v] = true;
        List<Integer>path = null;
        for (int i = 0; i < a.get(v).size(); i++) {
            if(!used[a.get(v).get(i)]) {
                if (path == null)
                    path = dfs(a, used, a.get(v).get(i));
                else
                    path.addAll(dfs(a, used, a.get(v).get(i)));
            }
        }
        if (path == null) path = new ArrayList<>(1);
        path.add(0, v);
        return path;
    }

    private static boolean isPalindrom(String s){
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    }
}

