n,k=map(int,input().split())
a=[0]*n
dp=[0]*n
s=[]
for i in range(n):
  a[i]=int(input())
cnt=1
dp[0]=cnt
s.append(a[0])
for i in range(1,n):
  for j in range(len(s)):
    if abs(s[j]-a[i])<=k:
      cnt+=1
      dp[i]=cnt
      s=[]
      break
  s.append(a[i])
print(cnt)