N, K = map(int, input().split()) X = [0] + list(map(int, input().split())) A = [0] + list(map(int, input().split())) L = R = K Ld, Rd = X[K] - A[K], X[K] + A[K] flag = True while flag: flag = False while L - 1 >= 1 and Ld <= X[L - 1]: flag = True L -= 1 Ld = min(Ld, X[L] - A[L]) Rd = max(Rd, X[L] + A[L]) while R + 1 <= N and Rd >= X[R + 1]: flag = True R += 1 Rd = max(Rd, X[R] + A[R]) Ld = min(Ld, X[R] - A[R]) print(R - L + 1)