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.util.*;
import java.io.*;
import java.math.*;
public class Solution{
    public static boolean check(int c,int[] x,int n,int z){
        if(c>n/2) return false;
        for(int i=0;i<c;i++){
            if(x[i]+z>x[n-c+i]) return false; 
        }
        return true;
    }
    public static int damj(int[] x,int n,int z){
        boolean[] ok = new boolean[n];
        Arrays.fill(ok,false);
        int j = 1;
        int res = 0;
        for(int i=0;i<n-1;i++){
            if(ok[i]) continue;
            if(j<=i) j = i+1;
            while(j<n){
                if(ok[j]) j++;
                else{
                    if(x[i]+z>x[j]) j++;
                    else{
                        ok[i] = true;
                        ok[j] = true;
                        res++;
                        j++;
                        break;
                    }
                }
            }
            if(j==n) break;
        }
        return res;
    }
    static void merge(int arr[], int l, int m, int r) 
    { 
        // Find sizes of two subarrays to be merged 
        int n1 = m - l + 1; 
        int n2 = r - m; 
  
        /* Create temp arrays */
        int L[] = new int [n1]; 
        int R[] = new int [n2]; 
  
        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i) 
            L[i] = arr[l + i]; 
        for (int j=0; j<n2; ++j) 
            R[j] = arr[m + 1+ j]; 
  
  
        /* Merge the temp arrays */
  
        // Initial indexes of first and second subarrays 
        int i = 0, j = 0; 
  
        // Initial index of merged subarry array 
        int k = l; 
        while (i < n1 && j < n2) 
        { 
            if (L[i] <= R[j]) 
            { 
                arr[k] = L[i]; 
                i++; 
            } 
            else
            { 
                arr[k] = R[j]; 
                j++; 
            } 
            k++; 
        } 
  
        /* Copy remaining elements of L[] if any */
        while (i < n1) 
        { 
            arr[k] = L[i]; 
            i++; 
            k++; 
        } 
  
        /* Copy remaining elements of R[] if any */
        while (j < n2) 
        { 
            arr[k] = R[j]; 
            j++; 
            k++; 
        } 
    } 
  
    // Main function that sorts arr[l..r] using 
    // merge() 
    static void sort(int arr[], int l, int r) 
    { 
        if (l < r) 
        { 
            // Find the middle point 
            int m = (l+r)/2; 
  
            // Sort first and second halves 
            sort(arr, l, m); 
            sort(arr , m+1, r); 
  
            // Merge the sorted halves 
            merge(arr, l, m, r); 
        } 
    } 
    public static void main(String[] args)throws IOException{
        BufferedReader br =  new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int z = Integer.parseInt(st.nextToken());
        int[] x = new int[n];
        st = new StringTokenizer(br.readLine());
        for(int i=0;i<n;i++) x[i] = Integer.parseInt(st.nextToken());
        //Arrays.sort(x);
        sort(x,0,n-1);
        int l=0;//damj(x,n,z);
        //if(n==200000) out.println(l);
        int r=n/2+1;//Math.max(Math.min(l*2,n/2+1),2000);
        while(l<r){
            if(l==r-1) break;
            int c = l+r;
            c /= 2;
            if(check(c,x,n,z)){
                l = c;
            }else r = c;
        }
        out.println(l);
        out.flush();
   }
}