#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, i, lp, hp;
  cin >> n >> d;
  int a[n], p[n];
  hp = n - 1;
  lp = 1;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> p[i];
  }
  int sc = a[d - 1] + p[0], ans = 1, x = 0;
  for (i = 0; i < n; i++) {
    if (a[i] > sc) {
      lp++;
      ans++;
      x++;
    } else
      break;
  }
  for (i = x; i < n; i++) {
    if (a[i] + p[hp] > sc && x != d) {
      ans++;
      lp++;
    } else {
      hp--;
    }
  }
  cout << ans << endl;
}
