n,k = map(int,input().split()) X = list(map(int,input().split())) A = list(map(int,input().split())) k -= 1 r = k+1 rx = X[k]+A[k] while r < n: if X[r] <= rx: rx = max(rx,X[r]+A[r]) r += 1 else: break l = k-1 lx = X[k]-A[k] while 0 <= l: if X[l] >= lx: lx = min(lx,X[l]-A[l]) l -= 1 else: break print(r-l-1)