""" https://yukicoder.me/problems/no/871 範囲が区間になるのを活用するはず """ N,K = map(int,input().split()) X = list(map(int,input().split())) A = list(map(int,input().split())) L = [ (X[i],A[i]) for i in range(K-1) ] R = [ (X[i],A[i]) for i in range(K,N) ] R.reverse() now = [ X[K-1] - A[K-1] , X[K-1] + A[K-1] ] flag = True while flag: flag = False if L and now[0] <= L[-1][0] <= now[1]: x,a = L.pop() now[0] = min(now[0], x-a) now[1] = max(now[1], x+a) flag = True if R and now[0] <= R[-1][0] <= now[1]: x,a = R.pop() now[0] = min(now[0], x-a) now[1] = max(now[1], x+a) flag = True print (N - len(L) - len(R))