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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

public class D {
	static FastReader scan = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		Solver solver = new Solver();
		int testCases = 1;
		while (testCases-- > 0) solver.solve();
		out.close();
	}

	static class Solver {
		void solve() {
			int n = scan.nextInt(), z = scan.nextInt();
			int[] a = scan.nextIntArray(n);
			Extra.sort(a);
			int low = 0, high = n/2;
			outer:
			while(low < high) {
				int mid = (low+high+1)/2;
				for(int i = 0; i < mid; i++) {
					if(a[i]+z > a[n-mid+i]) {
						high = mid-1;
						continue outer;
					}
				}
				low = mid;
			}
			out.println(low);
		}
	}
}

//Sathvik's Template Stuff Below

class DSU {
	int[] root, size;
	int n;
	DSU(int n) {
		this.n = n;
		root = new int[n];
		size = new int[n];
		for(int i = 0; i < n; i++) {
			root[i] = i;
			size[i] = 1;
		}
	}
	int findParent(int idx) {
		while(root[idx] != idx) {
			root[idx] = root[root[idx]];
			idx = root[idx];
		}
		return idx;
	}	
	boolean union(int x, int y) {
		int parX = findParent(x);
		int parY = findParent(y);
		if(parX == parY) return false;
		if(size[parX] < size[parY]) {
			root[parY] = parX;
			size[parX] += size[parY]+1;
		} else {
			root[parX] = parY;
			size[parY] += size[parX]+1; 
		}
		return true;
	}
}

class Extra {
	static void sort(int[] a) {
		Integer[] aa = new Integer[a.length];
		for (int i = 0; i < aa.length; i++)
			aa[i] = a[i];
		Arrays.sort(aa);
		for (int i = 0; i < aa.length; i++)
			a[i] = aa[i];
	}
	static void sort(long[] a) {
		Long[] aa = new Long[a.length];
		for (int i = 0; i < aa.length; i++)
			aa[i] = a[i];
		Arrays.sort(aa);
		for (int i = 0; i < aa.length; i++)
			a[i] = aa[i];
	}
	static void sort(double[] a) {
		Double[] aa = new Double[a.length];
		for (int i = 0; i < aa.length; i++)
			aa[i] = a[i];
		Arrays.sort(aa);
		for (int i = 0; i < aa.length; i++)
			a[i] = aa[i];
	}
	static void sort(char[] a) {
		Character[] aa = new Character[a.length];
		for (int i = 0; i < aa.length; i++)
			aa[i] = a[i];
		Arrays.sort(aa);
		for (int i = 0; i < aa.length; i++)
			a[i] = aa[i];
	}
	static long gcd(long a, long b) {
		while(b > 0) {
			long temp = b;
			b = a%b;
			a = temp;
		}
		return a;
	}
	static long lcm(long a, long b) {
		return a * (b / gcd(a,b));
	}
	static boolean isPrime(long n) {
		if (n <= 1) return false; 
        if (n <= 3) return true; 
        if (n % 2 == 0 || n % 3 == 0) return false; 
        for (long i = 5; i * i <= n; i = i + 6) { 
            if (n % i == 0 || n % (i + 2) == 0) return false; 
        }
        return true;
	}
	static HashSet<Integer> sieve(int n) {
		boolean[] prime = new boolean[n+1];
		HashSet<Integer> res = new HashSet<>();
		for(int p = 2; p*p <= n; p++) {
			if(!prime[p]) {
				res.add(p);
				for(int i = p*p; i <= n; i+=p) prime[i] = true;
			}
		}
		return res;
	}
	static HashMap<Long, Integer> primeFactorization(long n) {
		HashMap<Long, Integer> res = new HashMap<>();
		while(n % 2 == 0) {
			res.put(2L, res.getOrDefault(2L, 0)+1);
			n/=2;
		}
		for(long i = 3; i*i <= n; i+=2) {
			while(n % i == 0) {
				res.put(i, res.getOrDefault(i, 0)+1);
				n/=i;
			}
		}
		if(n > 2) res.put(n, 1);
		return res;
	}
}

class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

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

	int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}

	double[] nextDoubleArray(int n) {
		double[] a = new double[n];
		for (int i = 0; i < n; i++)
			a[i] = nextDouble();
		return a;
	}

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}
}