#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  int brr[n];
  vector<int> diff;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = k - 2; i >= 0; i--) {
    diff.push_back(arr[i] - arr[k - 1]);
  }
  for (int i = 0; i < n; i++) {
    cin >> brr[i];
  }
  if (k == 1) {
    cout << 1;
    return 0;
  }
  int p = 0, dumb = k;
  int i = 1;
  while (i < n) {
    if (diff[p] + brr[i] <= brr[0] && p < dumb) {
      k--;
      p++;
    }
    i++;
  }
  cout << max(k, 1);
  return 0;
}
