import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt() - 1; long[] xArr = new long[n + 2]; for (int i = 1; i <= n; i++) { xArr[i] = sc.nextLong(); } xArr[0] = Long.MIN_VALUE; xArr[n + 1] = Long.MAX_VALUE; long[] aArr = new long[n + 1]; for (int i = 1; i <= n; i++) { aArr[i] = sc.nextLong(); } int min = Integer.MAX_VALUE; int target = k; while (min != target) { min = target; int left = 0; int right = target; while (right - left > 1) { int m = (left + right) / 2; if (xArr[target] - xArr[m] <= aArr[target]) { right = m; } else { left = m; } } target = right; } int max = Integer.MIN_VALUE; target = k; while (max != target) { max = target; int left = target; int right = n; while (right - left > 1) { int m = (left + right) / 2; if (xArr[m] - xArr[target] <= aArr[target]) { left = m; } else { right = m; } } target = left; } System.out.println(max - min + 1); } }