We've got no test cases. A big olympiad is coming up. But the problemsetters' number one priority should be adding another problem to the round.

The diameter of a multiset of points on the line is the largest distance between two points from this set. For example, the diameter of the multiset {1, 3, 2, 1} is 2.

Diameter of multiset consisting of one point is 0.

You are given n points on the line. What is the minimum number of points you have to remove, so that the diameter of the multiset of the remaining points will not exceed d?

Input

The first line contains two integers n and d (1 ≤ n ≤ 100, 0 ≤ d ≤ 100) — the amount of points and the maximum allowed diameter respectively.

The second line contains n space separated integers (1 ≤ xi ≤ 100) — the coordinates of the points.

Output

Output a single integer — the minimum number of points you have to remove.

Examples

Input

3 1
2 1 4


Output

1


Input

3 0
7 7 7


Output

0


Input

6 3
1 3 4 6 9 10


Output

3

Note

In the first test case the optimal strategy is to remove the point with coordinate 4. The remaining points will have coordinates 1 and 2, so the diameter will be equal to 2 - 1 = 1.

In the second test case the diameter is equal to 0, so its is unnecessary to remove any points. 

In the third test case the optimal strategy is to remove points with coordinates 1, 9 and 10. The remaining points will have coordinates 3, 4 and 6, so the diameter will be equal to 6 - 3 = 3.
#!/usr/bin/env python

#NYAN NYAN
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
#░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░
#░░░░░░░░▄▀░░░░░░░░░░░░▄░░░░░░░▀▄░░░░░░░
#░░░░░░░░█░░▄░░░░▄░░░░░░░░░░░░░░█░░░░░░░
#░░░░░░░░█░░░░░░░░░░░░▄█▄▄░░▄░░░█░▄▄▄░░░
#░▄▄▄▄▄░░█░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██░░
#░██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██░░
#░░▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██░
#░░░░▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██░
#░░░░░░░▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██░
#░░░░░░░▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀░░
#░░░░░░█▀▀█████████▀▀▀▀████████████▀░░░░
#░░░░░░████▀░░███▀░░░░░░▀███░░▀██▀░░░░░░
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░


import sys
ReadEncoding = sys.stdin.encoding
WriteEncoding = sys.stdout.encoding
LogEncoding = sys.stderr.encoding
ReadEncoding = 'utf-8'
WriteEncoding = 'utf-8'
LogEncoding = 'utf-8'
PythonVersion = sys.version_info[0]
ReadEncoding = 'bytes'
import logging
import logging.handlers


ReadTarget = None
WriteTarget = None

def convert_to_bytes(arg):
	if(PythonVersion < 3):

		if isinstance(arg, bytes):
			return arg
		elif isinstance(arg, str):
			return arg.encode()
		elif hasattr(arg, '__iter__'):
			return b' '.join(map(convert_to_bytes, arg))
		else:
			return bytes(arg)
	else:
		if isinstance(arg, bytes):
			return arg.decode(WriteEncoding)
		elif isinstance(arg, str):
			return arg
		elif hasattr(arg, '__iter__'):
			return ' '.join(map(convert_to_bytes, arg))
		else:
			return str(arg)

		pass

	# if(WriteEncoding == 'bytes'):
	# 	if isinstance(arg, bytes):
	# 		return arg
	# 	elif isinstance(arg, str):
	# 		return arg.encode()
	# 	elif hasattr(arg, '__iter__'):
	# 		return b' '.join(map(convert_to_bytes, arg))
	# 	else:
	# 		return bytes(arg)
	# elif(WriteEncoding != 'bytes'):
	# 	if isinstance(arg, bytes):
	# 		return arg.decode(WriteEncoding)
	# 	elif isinstance(arg, str):
	# 		return arg
	# 	elif hasattr(arg, '__iter__'):
	# 		return ' '.join(map(convert_to_bytes, arg))
	# 	else:
	# 		return str(arg)
	# else:
	# 	raise ValueError

	if isinstance(arg, bytes):
		return arg.decode(WriteEncoding)
	elif isinstance(arg, str):
		return arg
	elif hasattr(arg, '__iter__'):
		return ' '.join(map(convert_to_bytes, arg))
	else:
		return str(arg)

	# if isinstance(arg, bytes):
	# 	if(PythonVersion >= 3):
	# 		return str(arg)
	# 	return arg
	# elif isinstance(arg, str):
	# 	if(PythonVersion >= 3):
	# 		return arg
	# 	else:
	# 		return arg.encode('utf-8')
	# elif hasattr(arg, '__iter__'):
	# 	if(PythonVersion >= 3):
	# 		return ' '.join(list(map(convert_to_bytes, arg)))
	# 	else:
	# 		return b' '.join(map(convert_to_bytes, arg))
	# else:
	# 	return str(arg)

# Copyright (c) 2018 Maxim Buzdalov. Modified by Epikem
class edx_in:
	def __init__(self, target = None):
		self.target = target
	def create_lineTokenizer(self):
		if(self.mm):
			for line in iter(self.mm.readline, ''):
				yield line
		else:
			for line in iter(self.stream.readline, ''):
				yield line

	def __enter__(self):
		self.mm = None
		self.isFileEmpty = True
		self.stream = sys.stdin

		self.lines = self.create_lineTokenizer()

		self.lineTokens = None
		return self

	def __exit__(self, type, value, traceback):
		if(not self.isFileEmpty):
			if(self.mm):
				self.mm.close()
			self.stream.close()
	def next_line(self):
		ret = None
		try:
			if(ReadEncoding == 'bytes'):
				ret = b' '.join(self.lineTokens)
				if(ret == b''):
					raise ValueError()
			else:
				ret = ' '.join(self.lineTokens)
				if(ret == ''):
					raise ValueError()
		except (ValueError, TypeError) as e:
			self.lineTokens.close()
			if(hasattr(self.lines, 'next')):
				ret = self.lines.next()
			if(hasattr(self.lines, '__next__')):
				ret = self.lines.__next__()
			pass
		finally:
			if(ReadEncoding == 'bytes'):
				ret = ret
			else:
				ret = ret.decode(ReadEncoding)
			return ret

	def next_int(self):
		return int(self.next_token())

	def next_float(self):
		return float(self.next_token())
	def next_str(self):
		ret = self.next_token()
		if(isinstance(ret, bytes)):
			return ret.decode()
		return ret
	def getLineTokens(self, line):
		for token in iter(line.split()):
			yield token
	def nextNToken(self, rep = 0):

		ans = []
		while(rep > 0):
			ans.append(self.next_token())
			rep -= 1
		#TODO : Determine return value : iterator? or joined string? or array?
		return ans
	def next_token(self):
		try:
			if(hasattr(self.lineTokens, 'next')):
				ret = self.lineTokens.next()
			if(hasattr(self.lineTokens, '__next__')):
				ret = self.lineTokens.__next__()
			return ret
		except:
			self.lineTokens = self.getLineTokens(self.next_line())

			return self.next_token()

# Copyright (c) 2018 Maxim Buzdalov. Modified by Epikem
class edx_out:
	def __init__(self, target = None):
		self.target = target

	def __enter__(self):
		import platform
		self.is_cpython = (platform.python_implementation() == 'CPython')
		if(False):
			pass
		else:
			self.stream = sys.stdout
		return self

	def __exit__(self, type, value, traceback):
		pass
	def write(self, arg):
		self.stream.write(convert_to_bytes(arg))

	def writeln(self, arg):
		if(WriteEncoding == 'bytes'):
			self.write(b'\n')
		else:
			self.write('\n')

	def test(this, expression):
		frame = sys._getframe(1)
		exp = expression
		ans = repr(eval(exp, frame.f_globals, frame.f_locals))
		if(WriteEncoding == 'bytes'):
			this.debug(b'test : ' + exp.encode(WriteEncoding) + b' = ' + ans.encode(WriteEncoding))
		else:
			this.debug('test : ' + exp + ' = ' + ans)
		pass

#endregion Default IO Functions

sys.setrecursionlimit(100)

#region Helper Functions
















#endregion

def solve():
	debug('ssss')
	def cf940a():
		n, d = ri(), ri()
		arr = []
		for i in range(n):
			arr.append(ri())
		arr.sort()
		start = 0
		target = start
		maxCount = 0
		curCount = 0
		for start in range(len(arr)):
			cnt = 1
			target = start
			while(True):
				debug(arr)
				debug(start, target, arr[start], arr[target], cnt)
				cnt += 1
				target += 1
				if(target >= len(arr)):
					cnt -= 1
					break
				if(arr[target] - arr[start] > d):
					cnt-=1
					break
			if(cnt > maxCount):
				maxCount = cnt
			if(target >= len(arr)):
				break
			pass


			pass
		debug('max : ', maxCount)
		put(len(arr) - maxCount)
		pass
	cf940a()
	pass

# logging


try:
	logger1 = logging.getLogger('log1')
	debug = lambda *x: logger1.log(logging.DEBUG,convert_to_bytes(x))

	PutLevel = 100
	logging.PUT = PutLevel
	logging.addLevelName(PutLevel, 'PUT')
	logger1.setLevel(logging.PUT)
	formatter = logging.Formatter()
except:
	pass

#WriteTarget = None
with edx_in(ReadTarget) as Reader, edx_out(WriteTarget) as Writer:

	try:
		outHandler = logging.StreamHandler(Writer.stream)
		outHandler.setFormatter(formatter)
		logger1.addHandler(outHandler)
		if(PythonVersion >= 3):
			put = lambda *args: logger1.log(logging.PUT,convert_to_bytes(args))
			info = lambda *args: logger1.log(logging.INFO,convert_to_bytes(args))
			critical = lambda *args: logger1.log(logging.CRITICAL,convert_to_bytes(args))
		else:
			put = lambda *args: logger1.log(logging.PUT,convert_to_bytes(args))
			info = lambda *args: logger1.log(logging.INFO,convert_to_bytes(args))
			critical = lambda *args: logger1.log(logging.CRITICAL,convert_to_bytes(args))
	except ModuleNotFoundError: # judge does not have logging module.
		debug = Writer.writeln
		put = Writer.writeln
		info = Writer.writeln
		critical = Writer.writeln
	def nop(*arg):
		pass
	debug = nop
	test = nop
	info = nop

	reader = Reader
	writer = Writer
	ri = reader.next_int
	rs = reader.next_str
	rt = reader.next_token
	rf = reader.next_float
	rl = reader.next_line
	rnt = reader.nextNToken
	wl = writer.writeln

	solve()


