N,K = map(int, input().split())
A = [int(input()) for i in range(N)]
 
i_list = []
for i in range(N-1):
  for j in range(i+1,N):
    f = abs(A[j]-A[i])
    if f <= K:
      i_list.append(i)

print(i_list)
cnt = 1
first = i_list[0]
F = A[first]
for i in range(first+1,N):
  num = abs(A[i]-F)
  if num <= K:
    F = A[i]
    cnt +=1
    
print(cnt)