# しゃくとり法に近い、two pointer、left_min, right_max, left_idx, right_idxを管理してwhile使う N, K = map(int, input().split()) X = list(map(int, input().split())) A = list(map(int, input().split())) K -= 1 left_idx = K right_idx = K left_min = X[K]-A[K] right_max = X[K]+A[K] #print('left_idx', left_idx, 'right_idx', right_idx, 'left_min', left_min, 'right_max', right_max) while left_idx>0 or right_idx=0 and left_min <= X[left_idx-1] <= right_max: improve = True left_idx -= 1 left_min = min(left_min, X[left_idx]-A[left_idx]) right_max = max(right_max, X[left_idx]+A[left_idx]) while right_idx+1<=N-1 and left_min <= X[right_idx+1] <= right_max: improve = True right_idx += 1 left_min = min(left_min, X[right_idx]-A[right_idx]) right_max = max(right_max, X[right_idx]+A[right_idx]) #print('left_idx', left_idx, 'right_idx', right_idx, 'left_min', left_min, 'right_max', right_max, 'improve', improve) if improve == False: break #print('left_idx', left_idx, 'right_idx', right_idx) ans = right_idx+1-left_idx print(ans)