#include <bits/stdc++.h>
using namespace std;
int s[200001], p[200001];
bool a[200001];
int main() {
  int n, d;
  scanf("%d%d", &n, &d);
  int g;
  bool f = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i]);
  }
  int w;
  w = s[d];
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
  }
  for (int i = d; i <= n - 1; i++) s[i] = s[i + 1];
  sort(s + 1, s + n);
  sort(p + 1, p + n + 1);
  int ans = w + p[n];
  int tot = n - 1;
  int gg = 1;
  int sum = 1, jj = 1, ww;
  for (int i = n - 1; i >= 1; i--) {
    if (gg > tot) break;
    if (s[i] + p[gg] > ans) {
      tot--;
      sum++;
    } else {
      gg++;
    }
  }
  cout << sum << endl;
  return 0;
}
