def main(): N, K = map(int, input().split()) X = list(map(int, input().split())) A = list(map(int, input().split())) l = r = K - 1 ld = X[K-1] - A[K-1] rd = X[K-1] + A[K-1] updated = True while updated: updated = False while l - 1 >= 0 and ld <= X[l - 1]: updated = 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]: updated = True r += 1 ld = min(ld, X[r] - A[r]) rd = max(rd, X[r] - A[r]) print(r - l + 1) if __name__ == "__main__": main()