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.*;
import java.util.*;

public class tr2 {
	static PrintWriter out;
	static StringBuilder sb;

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		int z = sc.nextInt();
		Integer[] a = new Integer[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		int lo=0; 
		int hi=n;
		int ans=0;
		Arrays.sort(a);
	//	System.out.println(Arrays.toString(a));
		while(lo<=hi) {
			int mid=(lo+hi)/2;
			//System.out.println(mid+" @");
			boolean f=false;
			Queue <Integer> q=new LinkedList<>();
			Queue <Integer> q1=new LinkedList<>();
			int idx=0;
			while(idx<n && idx<mid) {
				q.add(a[idx]);
				idx++;
			}
			while(idx<n) {
				q1.add(a[idx]);
				idx++;
			}
			int c=0;
			while(!q.isEmpty() && !q1.isEmpty()) {
				int k=q.remove();
				while(!q1.isEmpty()) {
					if(q1.peek()-k>=z) {
						q1.remove();
						c++;
						break;
				}
					else
						q1.remove();
				}
			}
			if(c==mid)
				f=true;
			if(f) {
				lo=mid+1;
				ans=mid;
			}
			else 
				hi=mid-1;
		}
		out.print(ans);
		out.flush();
	}
  static class pair2 implements Comparable<pair2>{
	  int idx;
	  int occ;
	  pair2(int i,int o){
		  idx=i;
		  occ=o;
	  }
	  public String toString() {
			return idx + " " + occ;
		}
	@Override
	public int compareTo(pair2 o) {
		if(o.occ==occ)
			return o.occ-occ;
		return idx-o.idx;
	}
  }
	static public class pair  {
		int idx;
		TreeSet <Integer>v;

		public pair(int i, TreeSet<Integer> v) {
			idx = i;
			this.v = v;
		}

		public String toString() {
			return idx + " " + v;
		}

	//	public int compareTo(pair o) {
			//if(o.v!=v)
			//    return v-o.v;
		//	return idx-o.idx;
	//	}
	}

	static double trr(double[] a) {
		double res = 0;
		double min = 0, max = 0, sum = 0;
		for (int i = 0; i < a.length; i++) {
			sum += a[i];
			res = Math.max(res, Math.max(max - sum, sum - min));
			min = Math.min(min, sum);
			max = Math.max(max, sum);
		}
		return res;
	}

	static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	static class unionfind {
		int[] p;
		int[] size;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];

			for (int i = 0; i < n; i++) {
				p[i] = i;
			}
			Arrays.fill(size, 1);
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			return p[v] = findSet(p[v]);
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		int max() {
			int max = 0;
			for (int i = 0; i < size.length; i++)
				if (size[i] > max)
					max = size[i];
			return max;
		}

		void combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];

			} else {
				p[a] = b;
				size[b] += size[a];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}