import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict import bisect input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') def index_lt(a, x): 'return largest index s.t. A[i] < x or -1 if it does not exist' return bisect.bisect_left(a, x) - 1 def index_le(a, x): 'return largest index s.t. A[i] <= x or -1 if it does not exist' return bisect.bisect_right(a, x) - 1 def index_gt(a, x): 'return smallest index s.t. A[i] > x or len(a) if it does not exist' return bisect.bisect_right(a, x) def index_ge(a, x): 'return smallest index s.t. A[i] >= x or len(a) if it does not exist' return bisect.bisect_left(a, x) class SegTree: def __init__(self, N, func, e): self.N = N self.func = func self.X = [e] * (N << 1) self.e = e def build(self, seq): for i in range(self.N): self.X[self.N + i] = seq[i] for i in range(self.N)[::-1]: self.X[i] = self.func(self.X[i << 1], self.X[i << 1 | 1]) def add(self, i, x): i += self.N self.X[i] += x while i > 1: i >>= 1 self.X[i] = self.func(self.X[i << 1], self.X[i << 1 | 1]) def update(self, i, x): i += self.N self.X[i] = x while i > 1: i >>= 1 self.X[i] = self.func(self.X[i << 1], self.X[i << 1 | 1]) def query(self, L, R): L += self.N R += self.N vL = self.e vR = self.e while L < R: if L & 1: vL = self.func(vL, self.X[L]) L += 1 if R & 1: R -= 1 vR = self.func(self.X[R], vR) L >>= 1 R >>= 1 return self.func(vL, vR) N, K = map(int, input().split()) K -= 1 X = list(map(int, input().split())) A = list(map(int, input().split())) left = [] right = [] for i in range(N): l = index_ge(X, X[i] - A[i]) r = index_le(X, X[i] + A[i]) left.append(l) right.append(r) INF = 1 << 60 lst = SegTree(N, min, INF) rst = SegTree(N, max, -INF) lst.build(left) rst.build(right) E = [None] * N for i in range(N): l = lst.query(left[i], right[i] + 1) r = rst.query(left[i], right[i] + 1) E[i] = (max(l, 0), min(r, N - 1)) dq = deque([K]) visited = [False] * N l = INF r = -INF while len(dq) > 0: v = dq.popleft() if visited[v] is True: continue visited[v] = True l = min(l, v) r = max(r, v) for d in E[v]: if visited[d] is False: dq.append(d) print(r - l + 1)