#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, s[200005], p[200005];
  scanf("%d%d", &n, &d);
  int i, j = 0;
  for (i = 1; i <= n; i++) scanf("%d", &s[i]);
  for (i = 1; i <= n; i++) scanf("%d", &p[i]);
  int l = s[d] + p[1];
  j = 2;
  int k = d - 1;
  while (j <= n && k >= 1) {
    if (s[k] + p[j] <= l) {
      j++;
      k--;
    } else {
      j++;
    }
  }
  printf("%d\n", k + 1);
  return 0;
}
