N, K = map(int, input().split()) X = list(map(int, input().split())) A = list(map(int, input().split())) lt = X[K - 1] - A[K - 1] rt = X[K - 1] + A[K - 1] lidx = K - 1 ridx = K - 1 while True: update = False if lidx > 0 and X[lidx - 1] >= lt: lidx -= 1 lt = min(lt, X[lidx] - A[lidx]) rt = max(rt, X[lidx] - A[lidx]) update = True if ridx < N - 1 and X[ridx + 1] <= rt: ridx += 1 lt = min(lt, X[ridx] - A[ridx]) rt = max(rt, X[ridx] - A[ridx]) update = True if not update: break print(ridx - lidx + 1)