#define _USE_MATH_DEFINES #include using namespace std; //template #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; typedef pair P; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } templatevoid Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);} const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2; //template end int main(){ int n,k; scanf("%d%d",&n,&k); vector a(n),b(n); rep(i,0,n)scanf("%lld",&a[i]); rep(i,0,n)scanf("%lld",&b[i]); bool fl[100010]={}; fl[k-1]=1; rrep(i,k-2,-1){ if(abs(a[i]-a[i+1])<=b[i+1])fl[i]=1; else break; } rep(i,k,n){ if(abs(a[i-1]-a[i])<=b[i-1])fl[i]=1; else break; } int cnt=0; rep(i,0,n)if(fl[i])cnt++; printf("%d\n",cnt); return 0; }