#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t = 1;
  while (t--) {
    long long n, d;
    cin >> n >> d;
    vector<long long> temp(n);
    vector<long long> temp2(n);
    for (long long i = 0; i < n; i++) {
      cin >> temp[i];
    }
    for (long long i = 0; i < n; i++) {
      cin >> temp2[i];
    }
    long long i = 0;
    long long j = n - 1;
    if (d == 1) {
      cout << 1 << endl;
      continue;
    }
    long long score = temp[d - 1] + temp2[0];
    long long ans = d;
    while (i < d - 1) {
      if (temp[i] + temp2[j] <= score) {
        ans--;
        i++;
        j--;
      } else {
        i++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
