#include <bits/stdc++.h>
using namespace std;
int a[200010], p[200010];
int main() {
  int n, d, cnt, t = 2;
  scanf("%d%d", &n, &d);
  cnt = d;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  for (int i = d - 1; i >= 1; i--) {
    while (a[i] + p[t] > a[d] + p[1] && t <= n) t++;
    if (t > n)
      break;
    else {
      cnt--;
      t++;
    }
  }
  printf("%d\n", cnt);
}
