N,K = map(int, input().split()) X = [int(x) for x in input().split()] A = [int(a) for a in input().split()] l = K-1 p = A[l] while l > 0: p = min(p, X[l]-A[l]) if X[l-1] >= p: l -= 1 else: break r = K-1 p = A[r] while r < N-1: p = max(p, X[r]+A[r]) if X[r+1] <= p: r += 1 else: break print(r-l+1)