import sys
sys.setrecursionlimit(1000000)

def recursion(arr, length, idx, value, criteria, counta):
    if idx >= length:
        return counta
    if abs(arr[idx] - value) <= criteria:
        result_skip =  recursion(arr, length, idx + 1, value, criteria, counta)
        result_process = recursion(arr, length, idx + 1, arr[idx], criteria, counta+1)
        if result_skip >= result_process:
            return result_skip
        return result_process
    return recursion(arr, length, idx + 1, value, criteria, counta)
    
n, k = [int(i) for i in input().split()]
arr = [int(input()) for i in range(n)]

result = recursion(arr, n, 1, arr[0], k, 0)
print(result)
