n, k = map(int, input().split()) x = list(map(int, input().split())) a = list(map(int, input().split())) left = list(range(k-1)) right = list(range(n-1, k-1, -1)) lm, rm = x[k-1]-a[k-1], x[k-1]+a[k-1] while True: left_ok, right_ok = False, False if left != [] and x[left[-1]] >= lm: left_ok = True lm = min(lm, x[left[-1]]-a[left[-1]]) rm = max(rm, x[left[-1]]+a[left[-1]]) left.pop() if right != [] and x[right[-1]] <= rm: right_ok = True lm = min(lm, x[right[-1]]-a[right[-1]]) rm = max(rm, x[right[-1]]+a[right[-1]]) right.pop() if not left_ok and not right_ok: break print(n-len(left)-len(right))