#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair #define LP pair template void chmax(T& a, T b) { a = max(a, b); }; template void chmin(T& a, T b) { a = min(a, b); }; int main() { int n, k; cin >> n >> k; vector x(n+2),a(n+1); rep(i,n) cin >> x[i+1]; rep(i,n) cin >> a[i+1]; const ll INF = 1e18; x[0] = -INF, x[n+1] = INF; ll l = x[k]-a[k], r = x[k]+a[k]; int m = k, M = k; while (true) { int nxt = lower_bound(x.begin(),x.end(),l)-x.begin(); if (nxt == m) break; m = nxt; l = x[nxt]-a[nxt]; } while (true) { int nxt = lower_bound(x.begin(),x.end(),r)-x.begin(); if (nxt == M) break; M = nxt; r = x[nxt]-a[nxt]; } int ans = M-m+1; cout << ans << endl; return 0; }