// https://yukicoder.me/problems/no/871 #include using namespace std; using ll = long long; using pii = pair; #define EPS (1e-9) #define INF (1e9) #define INFL (1e18) #define MOD (1000000007) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define ALL(obj) (obj).begin(), (obj).end() #define ALLR(obj) (obj).rbegin(), (obj).rend() #define BIT(n) (1LL << (n)) // ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // ll lcm(ll c, ll d) { return c / gcd(c, d) * d; } int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, k; cin >> n >> k; vector x(n), a(n); REP(i, n) cin >> x[i]; REP(i, n) cin >> a[i]; ll t = k - 1; ll left = x[t] - a[t], right = x[t] + a[t]; while (t >= 0) { if (left > x[t]) { break; } left = min(left, x[t] - a[t]); t--; } t = k - 1; while (t <= n - 1) { if (right < x[t]) { break; } right = max(right, x[t] + a[t]); t++; } ll cnt = 0; REP(i, n) { if (x[i] >= left && x[i] <= right) cnt++; } cout << cnt << endl; return 0; }