#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; int main(){ int n, k; cin >> n >> k; k--; vector x(n), a(n); rep(i,n) cin >> x[i]; rep(i,n) cin >> a[i]; queue que; que.push(k); int minl = k, maxr = k; while (!que.empty()){ int i = que.front(); que.pop(); int l = lower_bound(x.begin(), x.end(), x[i] - a[i]) - x.begin(); int r = upper_bound(x.begin(), x.end(), x[i] + a[i]) - x.begin(); r--; while (l < minl){ minl--; que.push(minl); } while (maxr < r){ maxr++; que.push(maxr); } //cout << l << " " << r << endl; } cout << maxr - minl + 1 << endl; return 0; }