N, K = map(int, input().split()) X = list(map(int, input().split())) A = list(map(int, input().split())) hear = [K-1] cried = [] while len(hear): h = hear.pop() cried.append(h) for i, c in enumerate(X): if X[h] - A[h] <= c <= X[h] + A[h] and i not in cried: hear.append(i) print(len(cried))