A=list() N,M=map(int,input().split()) for i in range(N): a=int(input()) A.append(a) for i in range(N): L=list() L=[A[i]-j for j in A if A[i]-j>=M] print(len(L))