#include <bits/stdc++.h>
using namespace std;
long long a[200005];
long long p[200005];
int main() {
  int n, d;
  scanf("%d%d", &n, &d);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lld", &p[i]);
  long long g0 = 2;
  long long ans = 0;
  long long pnext = a[d] + p[1];
  for (int i = d - 1; i >= 1; i--) {
    while (g0 <= n && a[i] + p[g0] > pnext) g0++;
    if (g0 <= n) {
      ans++;
      g0++;
    }
  }
  printf("%lld\n", d - ans);
  return 0;
}
