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.*;

public class B {
    private static Solver solver = new Solver();

    public static void main(String[] args) throws IOException {
        solver.withProcedure(() -> {
            int N = solver.readInt();
            int K = solver.readInt();

            List<Long> bacteria = new ArrayList<>(N);
            Map<Integer, Integer> bacteriaCount = new HashMap<>();
            for (int i = 0; i < N; i++) {
                int current = solver.readInt();
                bacteria.add((long) current);

                bacteriaCount.merge(current, 1, (a, b) -> a + b);
            }
            Collections.sort(bacteria);

            int eaten = 0;
            for (int i = 0; i < N - 1; i++) {
                long small = bacteria.get(i);
                long big = bacteria.get(i + 1);

                if ((small < big) && (big <= (small + K))) {
                    eaten += bacteriaCount.get((int)small);
                }
            }

            solver.println("" + (N - eaten));
        }).solve();
    }


    @FunctionalInterface
    private interface Procedure {
        void run() throws IOException;
    }

    private static class Solver {
        private Procedure procedure;

        private StreamTokenizer in;
        private PrintWriter out;
        private BufferedReader bufferedReader;

        Solver() {
            try {
                boolean oj = System.getProperty("ONLINE_JUDGE") != null;

                Reader reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt");
                Writer writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt");

                bufferedReader = new BufferedReader(reader);
                in = new StreamTokenizer(bufferedReader);
                out = new PrintWriter(writer);
            } catch (Exception e) {
                throw new RuntimeException("Initialization has failed");
            }
        }

        void solve() throws IOException {
            procedure.run();
        }

        int readInt() throws IOException {
            in.nextToken();
            return (int) in.nval;
        }

        long readLong() throws IOException {
            in.nextToken();
            return (long) in.nval;
        }

        String readString() throws IOException {
            return bufferedReader.readLine();
        }

        char readChar() throws IOException {
            in.nextToken();
            return in.sval.charAt(0);
        }

        void println(String str) {
            out.println(str);
            out.flush();
        }

        void print(String str) {
            out.print(str);
            out.flush();
        }

        Solver withProcedure(Procedure procedure) {
            this.procedure = procedure;

            return this;
        }
    }
}
