n,k=map(int, input().split())

a=[]
for i in range(n):
    a.append(int(input()))

ans=[]

left=a[0]
ans.append(left)

for i in range(n-1):
    if abs(left-a[i+1])<=k:
        left=a[i+1]
        ans.append(left)

print(len(ans))