import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.PriorityQueue; import java.util.Scanner; import java.util.Set; import java.util.Stack; import java.util.TreeMap; import java.util.TreeSet; import static java.util.Comparator.*; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); Solver solver = new Solver(System.in, out); solver.solve(); out.close(); } } class Solver { Scanner sc; PrintWriter out; public Solver(InputStream in, PrintWriter out) { sc = new Scanner(in); this.out = out; } // ================================================================== public void solve() { int N = Integer.parseInt(sc.next()); int K = Integer.parseInt(sc.next()) - 1; long[] X = new long[N]; long[] A = new long[N]; for (int i = 0; i < N; i++) { X[i] = Long.parseLong(sc.next()); } for (int i = 0; i < N; i++) { A[i] = Long.parseLong(sc.next()); } int l = K, r = K; long lval = X[K] - A[K]; long rval = X[K] + A[K]; boolean flag = true; while(flag) { flag = false; while(l > 0 && X[l-1] >= lval) { flag = true; l--; lval = Math.min(lval, X[l] - A[l]); rval = Math.max(rval, X[l] + A[l]); } while(r < N - 1 && X[r+1] <= rval) { flag = true; r++; lval = Math.min(lval, X[r] - A[r]); rval = Math.max(rval, X[r] + A[r]); } } out.println(r - l + 1); } }