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).
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author cplayer
 */
public class Main {
    public static void main (String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CMatchPoints solver = new CMatchPoints();
        solver.solve(1, in, out);
        out.close();
    }

    static class CMatchPoints {
        private void mergeSort (int[] arr, int begin, int end) {
            if (end <= begin) {
                return;
            }
            int mid = (begin + end) >> 1;
            mergeSort(arr, begin, mid);
            mergeSort(arr, mid + 1, end);
            int[] target = new int[end - begin + 1];
            int pt1 = begin, pt2 = mid + 1, ptt = 0;
            while (pt1 <= mid && pt2 <= end) {
                if (arr[pt1] < arr[pt2]) {
                    target[ptt++] = arr[pt1++];
                } else {
                    target[ptt++] = arr[pt2++];
                }
            }
            if (pt1 <= mid && pt2 > end) {
                while (pt1 <= mid) {
                    target[ptt++] = arr[pt1++];
                }
            } else if (pt2 <= end && pt1 <= mid) {
                while (pt2 <= end) {
                    target[ptt++] = arr[pt2++];
                }
            }
            for (int i = 0; i < ptt; ++i) {
                arr[begin + i] = target[i];
            }
        }

        public void solve (int testNumber, InputReader in, PrintWriter out) {
        /*
            单纯贪心的反例：
            Case 1:
            10 2
            1 2 3 4 5 6 7 8 9 10
            Case 2:
            4 4
            1 5 6 9
        */
            int n = in.nextInt(), z = in.nextInt();
            int[] x = in.nextIntArr(n);
            mergeSort(x, 0, n - 1);
            // 从中间开始往后找，因为最大不超过n/2对
            // 加了限制条件以防超时
            int mid = n / 2;
            int pt = 0, ans = 0;
            while (pt < n / 2) {
                while (mid < n && x[mid] - x[pt] < z) {
                    mid++;
                }
                if (mid >= n) {
                    break;
                }
                ans++;
                pt++;
                mid++;
            }
            out.println(ans);
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader (InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next () {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return tokenizer.nextToken();
        }

        public int[] nextIntArr (int length) {
            int[] res = new int[length];
            for (int i = 0; i < length; ++i) {
                res[i] = nextInt();
            }
            return res;
        }

        public int nextInt () {
            return Integer.parseInt(next());
        }

    }
}

