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