row = input().split()
N = int(row[0])
K = int(row[1])

An = []

for i in range(0, N):
    An.append(input().split())

print(An)

for i in range(0, N-2):
    Bn = abs(An[i] - An[i+1])

cnt = 0
Cn = []

for i in range (len(Bn)):
    if Bn[i] <= K:
        cnt += 1
        Cn.append(cnt)
    else:
        cnt = 0

print(max(Cn))

