# K番から右と左に尺取り法 # 毎回min, maxを更新していき、それに合わせて尺取りを動かす N, K = map(int, input().split()) X = list(map(int, input().split())) A = list(map(int, input().split())) K -= 1 left = K right = K mn = X[K]-A[K] mx = X[K]+A[K] while True: improve = False while left > 1: if mn <= X[left-1]: left -= 1 improve = True mn = min(mn, X[left]-A[left]) mx = max(mx, X[left]+A[left]) else: break while right < N: if mx >= X[right+1]: right += 1 improve = True mn = min(mn, X[right]-A[right]) mx = max(mx, X[right]+A[right]) else: break #print('improve', improve, 'left', left, 'right', right) if improve == False: break ans = right+1-left print(ans)