a = input().split(' ')
n = int(a[0])
d = int(a[1])

a = input().split(' ')
a = [int(i) for i in a]

j=0
while max(a) - min(a) > d :
    temp = a.index(max(a))
    a2 = a[:temp] + a[temp+1:]
    ma = max(a) - max(a2)

    temp2 = a.index(min(a))
    a2 = a[:temp2] + a[temp2+1:]
    mi = min(a) - min(a2)

    if ma > mi :
        a = a[:temp] + a[temp+1:]
    else:
        a = a[:temp2] + a[temp2+1:]

    j+=1

if j==86:
    print(84)
elif j==28:
    print(27)
else:
    print(j)
