n,k = map(int,input().split())
a = [int(input()) for _ in range(n)]


ans = n

for i in range(n):
  if i == 0:
    if abs(a[i]-a[i+1]) > k:
      ans -= 1
  elif 0 < i < n-1:
    if abs(a[i]-a[i+1]) > k:
      ans -= 1
  elif i == n-1:
    if abs(a[i]-a[i-1]) > k:
      ans -= 1

print(ans)