N,K=map(int,input().split()) r=list(map(int,input().split())) A=list(map(int,input().split())) K-=1 left=r[K]-A[K] right=r[K]+A[K] K1=K while K1-1>=0 and left<=r[K1-1]<=right: left=min(r[K1-1]-A[K1-1],left) right=max(r[K1-1]+A[K1-1],right) K1-=1 low=K1 while K+1<=N-1 and r[K+1]<=right: right=max(r[K+1]+A[K+1],right) left=min(r[K+1]-A[K-1],left) K+=1 print(K-K1+1)