// 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]; k--; ll left = x[k] - a[k], right = x[k] + a[k]; for (int i = k; i >= 0; i--) { if (left > x[i]) { break; } left = min(left, x[i] - a[i]); } for (int i = k; i < n; i++) { if (right < x[i]) { break; } right = max(right, x[i] + a[i]); } ll cnt = 0; REP(i, n) { if (x[i] >= left && x[i] <= right) cnt++; } cout << cnt << endl; return 0; }