#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

n,k = ip()
x = [inp() for i in range(n)]
y = [x[0]]
for i in range(1,n):
    if abs(x[i]-y[-1]) <= k:
        y.append(x[i])
print(len(y))