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