# 尺取り法に近い # left, rightどこまでいけるかを毎回更新しつつ、left_idx, right_idxを動かしていく N, K = map(int, input().split()) X = list(map(int, input().split())) A = list(map(int, input().split())) start_idx = K-1 left = X[start_idx]-A[start_idx] right = X[start_idx]+A[start_idx] left_idx = start_idx right_idx = start_idx while left_idx >= 0 and right_idx <= N-1: improve = False # check left while left_idx-1 >= 0 and left <= X[left_idx-1] <= right: left = min(left, X[left_idx-1]-A[left_idx-1]) # left をrightから更新することはないはず、なぜならA幅は同じでrightの方が遠いから right = max(right, X[left_idx-1]+A[left_idx-1]) left_idx -= 1 improve = True # check right while right_idx+1 <= N-1 and left <= X[right_idx+1] <= right: left = min(left, X[right_idx+1]-A[right_idx+1]) right = max(right, X[right_idx+1]+A[right_idx+1]) right_idx += 1 improve = True #print('left', left, 'right', right, 'left_idx', left_idx, 'right_idx', right_idx) if improve == False: break ans = right_idx +1 - left_idx print(ans)