n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=a[::-1]
if n==1:
    print(0)
    exit(0)
for i in range(n-1):
        if b[i]-b[i+1]>k:
            print(max(i,n-i-2))
            exit(0)
    
for i in range(1,n):
    if a[i]-a[0]>k:
        break
for j in range(1,n):
     if b[0]-b[j]>k:
         break
print(n-i-1, n-j-1)   
print(max(n-i-1,n-j-1))  