#include <bits/stdc++.h>
using namespace std;
int a[220000], b[200002];
int main() {
  int n, d;
  scanf("%d %d", &n, &d);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
  }
  int maxnum = b[1] + a[d], pre = 2, gonext = 0, flag = 0;
  for (int i = d - 1; i >= 1; i--) {
    for (int j = pre; j <= n; j++) {
      flag = 0;
      if (b[j] + a[i] <= maxnum) {
        gonext++;
        pre = j + 1;
        flag = 1;
        break;
      }
    }
    if (!flag) break;
  }
  printf("%d\n", d - gonext);
  return 0;
}
