N, K = [int(i) for i in input().split()] X = [int(i) for i in input().split()] A = [int(i) for i in input().split()] left = right = K - 1 lower = X[left] - A[left] upper = X[right] + A[right] ans = -1 while ans != right - left: ans = right - left while 0 < left and lower <= X[left - 1]: left -= 1 upper = max(upper, X[left] + A[left]) lower = min(lower, X[left] - A[left]) while right < N - 1 and X[right + 1] <= upper: right += 1 upper = max(upper, X[right] + A[right]) lower = min(lower, X[right] - A[right]) print(ans + 1)