#include using namespace std; typedef long long ll; int main() { int N, K; cin >> N >> K; ll X[N], A[N]; for (int i = 0; i < N; i++) { cin >> X[i]; } for (int i = 0; i < N; i++) { cin >> A[i]; } K--; ll r = X[K] + A[K]; ll l = X[K] - A[K]; for (int i = K + 1; i < N; i++) { if (X[i] <= r) { r = max(r, X[i] + A[i]); l = min(l, X[i] - A[i]); } else { break; } } for (int i = K - 1; i >= 0; i--) { if (l <= X[i]) { r = max(r, X[i] + A[i]); l = min(l, X[i] - A[i]); } else { break; } } int cnt = 0; for (int i = 0; i < N; i++) { if ((l <= X[i] && X[i] <= X[K]) ||(X[K] <= X[i] && X[i] <= r)) { cnt++; } } //cout << l << " " << r << "\n"; cout << cnt << "\n"; return 0; }