import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,K = map(int,readline().split()) X = tuple(map(int,readline().split())) A = tuple(map(int,readline().split())) INF = 10 ** 18 X = (-INF,) + X + (INF,) A = (-INF,) + A + (INF,) L = X[K] - A[K] R = X[K] + A[K] answer = 1 def add_frog(n): global L, R, answer L = min(L, X[n] - A[n]) R = max(R, X[n] + A[n]) l = r = K while True: if X[l-1] >= L: l -= 1 add_frog(l) continue if X[r+1] <= R: r += 1 add_frog(r) continue break answer = r - l + 1 print(answer)