We've got no test cases. A big olympiad is coming up. But the problemsetters' number one priority should be adding another problem to the round.

The diameter of a multiset of points on the line is the largest distance between two points from this set. For example, the diameter of the multiset {1, 3, 2, 1} is 2.

Diameter of multiset consisting of one point is 0.

You are given n points on the line. What is the minimum number of points you have to remove, so that the diameter of the multiset of the remaining points will not exceed d?

Input

The first line contains two integers n and d (1 ≤ n ≤ 100, 0 ≤ d ≤ 100) — the amount of points and the maximum allowed diameter respectively.

The second line contains n space separated integers (1 ≤ xi ≤ 100) — the coordinates of the points.

Output

Output a single integer — the minimum number of points you have to remove.

Examples

Input

3 1
2 1 4


Output

1


Input

3 0
7 7 7


Output

0


Input

6 3
1 3 4 6 9 10


Output

3

Note

In the first test case the optimal strategy is to remove the point with coordinate 4. The remaining points will have coordinates 1 and 2, so the diameter will be equal to 2 - 1 = 1.

In the second test case the diameter is equal to 0, so its is unnecessary to remove any points. 

In the third test case the optimal strategy is to remove points with coordinates 1, 9 and 10. The remaining points will have coordinates 3, 4 and 6, so the diameter will be equal to 6 - 3 = 3.
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

public class Template {

    class Edge{
        int to;
        int num;
        Edge(int to, int num){
            this.to = to;
            this.num = num;
        }
    }

    class Vertex{
        int x, y;
        Vertex(int x, int y){
            this.x = x;
            this.y = y;
        }

    }
    String fileName = "";
    long MODULO = Long.MAX_VALUE;
    ArrayList<Integer>[] graph;
    boolean[] used;

    void solve() throws IOException {
        int n = readInt();
        int d = readInt();
        int[] a = readIntArray(n);
        Arrays.sort(a);
        int ans = 10000;
        for(int i=0; i<n; ++i){
            for(int j = i; j<n; ++j){
                if(Math.abs(a[i] - a[j] )<=d){
                    ans = Math.min(ans, i + n-1 - j);
                }
            }
        }
        out.println(ans);
    }

    boolean isLower(char c){
        return c >= 'a' && c <= 'z';
    }

    ////////////////////////////////////////////////////////////
    class Pair{
        int num;
        int val;
        Pair(int num, int val ){
            this.num = num;
            this.val = val;
        }
    }
    /*
    class SegmentTree {
        int start = 0;
        int end = 0;
        long delta;
        int n;
        long result;
        long[] t;
        boolean[] lazy;
        int[] length;
        Pair[] segments;
        SegmentTree(int n, int[] a){
            this.n = n;
            t = new long[4*n];
            lazy = new boolean[4*n];
            length = new int[4*n];
            segments = new Pair[4*n];
            build(a, 1, 1, n);
        }

        void build(int[] a, int v, int tl, int tr){
            if(tl>tr) return;
            if(tl == tr){
                t[v] = a[tl];
                length[v] = 1;
                return;
            }
            int mid = (tl+tr)/2;
            build(a, 2*v, tl, mid);
            build(a, 2*v+1, mid+1, tr);
            length[v] = tr - tl +1;
            t[v] = t[2*v] + t[2*v+1];
        }
        void pushVertex(int v, int vLeft, int vRight){
            lazy[vLeft] += lazy[v];
            lazy[vRight] += lazy[v];
            lazy[v] = 0;
        }

        void updateVertex(int v, int vLeft, int vRight){
            t[v] = getSum(vLeft) + getSum(vRight);
        }

        long getSum(int v){
            return t[v] + lazy[v] * length[v];
        }

        void incSegment(int start, int end, long delta){
            this.start = start;
            this.end = end;
            this.delta = delta;
            incSegment(1, 1, n);
        }

        void incSegment(int v, int l, int r){
            if(start <= l && r <= end){
                lazy[v] += delta;
            }else{
                int mid = (r+l)/2;
                int vLeft = (v << 1);
                int vRight = vLeft + 1;
                pushVertex(v, vLeft, vRight);

                if(start <= mid) incSegment(vLeft, l, mid);
                if(end >= mid +1) incSegment(vRight, mid+1, r);

                updateVertex(v, vLeft, vRight);
            }
        }

        long getSegment(int start, int end){
            this.start = start;
            this.end = end;
            this.result = 0;
            getSegment(1, 1, n);
            return result;
        }
        void getSegment(int v, int l, int r){
            if(start <= l && r <= end){
                result += getSum(v);
            }else{
                int mid = (r+l)/2;
                int vLeft = (v << 1);
                int vRight = vLeft + 1;
                pushVertex(v, vLeft, vRight);

                if(start <= mid) getSegment(vLeft, l, mid);
                if(end >= mid +1) getSegment(vRight, mid+1, r);

                updateVertex(v, vLeft, vRight);
            }
        }
    }
*/
    class Fenwik {
        long[] t;
        int length;

        Fenwik(int[] a) {
            length = a.length + 100;
            t = new long[length];

            for (int i = 0; i < a.length; ++i) {
                inc(i, a[i]);
            }
        }

        void inc(int ind, int delta) {
            for (; ind < length; ind = ind | (ind + 1)) {
                t[ind] += delta;
            }
        }

        long getSum(int r) {
            long sum = 0;
            for (; r >= 0; r = (r & (r + 1)) - 1) {
                sum += t[r];
            }
            return sum;
        }
    }
    int gcd(int a, int b){
        return b == 0 ? a : gcd(b, a%b);
    }

    long binPow(long a, long b, long m) {
        if (b == 0) {
            return 1;
        }
        if (b % 2 == 1) {
            return ((a % m) * (binPow(a, b - 1, m) % m)) % m;
        } else {
            long c = binPow(a, b / 2, m);
            return (c * c) % m;
        }

    }

    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Template().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    };

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";
    Random rnd = new Random();

    Template() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }
    byte readByte() throws NumberFormatException, IOException {
        return Byte.parseByte(readString());
    }
    int[] readIntArray (int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }
    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}