# 公式解説も同じ考え、区間を更新する、左端と右端 # 公式解説のやり方だと左も右も一歩ずつ進んでループがない # 左端限界値、右端限界値を管理 N, K = map(int, input().split()) INF = 10**20 X = [-INF]+list(map(int, input().split()))+[INF] A = [0]+list(map(int, input().split()))+[0] left_idx = K right_idx = K left_min = X[K]-A[K] right_max = X[K]+A[K] while True: update = False while left_idx-1 >= 1 and left_min <= X[left_idx-1]: update = 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 and right_max >= X[right_idx+1]: update = 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]) if update == False: break ans = right_idx + 1 - left_idx print(ans)