#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
inline long long read() {
  long long X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) w |= ch == '-', ch = getchar();
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
long long n, m, q;
long long da[maxn], d[maxn];
set<long long> h, l;
long long mod = 1e9 + 7;
signed main() {
  long long n = read(), dd = read();
  for (long long i = 0; i < n; i++) {
    da[i] = read();
  }
  for (long long i = 0; i < n; i++) {
    d[i] = read();
  }
  sort(d, d + n);
  long long x = da[dd - 1] + d[n - 1];
  swap(da[dd - 1], da[n - 1]);
  sort(da, da + n - 1);
  long long l = 0, r = n - 1, mid;
  while (l < r) {
    mid = (l + r) / 2;
    bool ok = true;
    for (long long i = 0; i < n - mid - 1; i++) {
      if (da[i] + d[n - 2 - mid - i] > x) ok = false;
    }
    if (ok)
      r = mid;
    else
      l = mid + 1;
  }
  cout << l + 1 << endl;
  return 0;
}
