#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 100;
int a[N], b[N];
int n, d;
int main() {
  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 base = a[d] + b[1];
  int cnt = d;
  int pos = 1;
  for (int i = n; i >= n - d + 2; i--) {
    int jud = 1;
    while (pos <= d - 1) {
      if (b[i] + a[pos] <= base) {
        jud = 0;
        cnt--;
        pos++;
        break;
      }
      pos++;
    }
    if (jud) break;
  }
  printf("%d\n", cnt);
  return 0;
}
