You are given a set of points x_1, x_2, ..., x_n on the number line.

Two points i and j can be matched with each other if the following conditions hold:

  * neither i nor j is matched with any other point; 
  * |x_i - x_j| ≥ z. 



What is the maximum number of pairs of points you can match with each other?

Input

The first line contains two integers n and z (2 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ z ≤ 10^9) — the number of points and the constraint on the distance between matched points, respectively.

The second line contains n integers x_1, x_2, ..., x_n (1 ≤ x_i ≤ 10^9).

Output

Print one integer — the maximum number of pairs of points you can match with each other.

Examples

Input


4 2
1 3 3 7


Output


2


Input


5 5
10 9 5 8 7


Output


1

Note

In the first example, you may match point 1 with point 2 (|3 - 1| ≥ 2), and point 3 with point 4 (|7 - 3| ≥ 2).

In the second example, you may match point 1 with point 3 (|5 - 10| ≥ 5).
/**
 * @author derrick20
 */
import java.io.*;
import java.util.*;

public class MatchPoints {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int N = sc.nextInt();
        int z = sc.nextInt();
        var nums = new TreeMap<Integer, Integer>();
        for (int i = 0; i < N; i++) {
            nums.merge(sc.nextInt(), 1, Integer::sum);
        }
/*
KEY ISSUE:
It's not correct to keep linearly considering low points to be paired with
some high point z or more away. We can view this pairings as intervals:
For some time, the intervals will all by intersecting, and during this
region, there is no better choice: we are starting from the lowest item
that is unused, and trying to pair it. In this case, our greedy idea is
optimal. We can't push the left pos any further left, since everything else
was also used optimally.

However, once we become disentangled from the previous intervals, we can actually
perform a shift left that maintains an optimal state: we re-entangle ourselves
with a previous interval! If we swap our left with something earlier's right,
then both intervals will necessarily be better off! Also, when we are picking
who to re-entangle with, the priority queue ensures that we maximize our
possibility of going left, picking the lowest high point available. If this
fails, then nothing else will work either!
 */
        var highs = new PriorityQueue<Integer>();
        Integer it;
        Integer paired;
        int ct = 0;
        while (nums.size() > 0 && (it = nums.firstKey()) != null) {
            nums.merge(it, -1, Integer::sum);
            if (nums.get(it) == 0) {
                nums.remove(it);
            }
            int val = it;
            if (highs.size() > 0 && it > highs.peek()) {
                val = highs.poll(); // we can actually swap these intersecting intervals safely!
                // we greedily pick the earliest thing to swap with. If that's still not ok, then
                // there's no way this'll ever be possible in the future!
                highs.add(it); // our lo just became a new endpoint
            }
            if ((paired = nums.ceilingKey((val + z))) != null) {
                nums.merge(paired, -1, Integer::sum);
                if (nums.get(paired) == 0) {
                    nums.remove(paired);
                }
                highs.add(paired);
                ct++;
            }
            else {
                break;
            }
        }
        out.println(ct);
        out.close();
    }


    static class FastScanner {
        private int BS = 1<<16;
        private char NC = (char)0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;

        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }

        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            }
            catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }

        private char getChar(){
            while(bId==size) {
                try {
                    size = in.read(buf);
                }catch(Exception e) {
                    return NC;
                }
                if(size==-1)return NC;
                bId=0;
            }
            return (char)buf[bId++];
        }

        public int nextInt() {
            return (int)nextLong();
        }

        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }

        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public long nextLong() {
            cnt=1;
            boolean neg = false;
            if(c==NC)c=getChar();
            for(;(c<'0' || c>'9'); c = getChar()) {
                if(c=='-')neg=true;
            }
            long res = 0;
            for(; c>='0' && c <='9'; c=getChar()) {
                res = (res<<3)+(res<<1)+c-'0';
                cnt*=10;
            }
            return neg?-res:res;
        }

        public double nextDouble() {
            double cur = nextLong();
            return c!='.' ? cur:cur+nextLong()/cnt;
        }

        public String next() {
            StringBuilder res = new StringBuilder();
            while(c<=32)c=getChar();
            while(c>32) {
                res.append(c);
                c=getChar();
            }
            return res.toString();
        }

        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while(c<=32)c=getChar();
            while(c!='\n') {
                res.append(c);
                c=getChar();
            }
            return res.toString();
        }

        public boolean hasNext() {
            if(c>32)return true;
            while(true) {
                c=getChar();
                if(c==NC)return false;
                else if(c>32)return true;
            }
        }
    }
}