#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n;
  cin >> n;
  long long d;
  cin >> d;
  vector<long long> v(n), l(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  for (long long i = 0; i < n; i++) cin >> l[i];
  long long pos = n - 1;
  long long best = 1;
  for (long long i = 0; i < d; i++) {
    if (v[i] > v[d - 1] + l[0])
      best++;
    else {
      if (v[i] + l[pos] > v[d - 1] + l[0])
        best++;
      else
        pos--;
    }
  }
  cout << best;
  return 0;
}
