#include <bits/stdc++.h>
using namespace std;
long long n, d;
long long s[200005], p[200005];
bool cmp(long long aa, long long bb) { return aa > bb; }
int main() {
  scanf("%lld%lld", &n, &d);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &s[i]);
  sort(s + 1, s + n + 1, cmp);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &p[i]);
  sort(p + 1, p + n + 1, cmp);
  long long now = s[d] + p[1], L = n - d + 2, R = n;
  for (long long i = d - 1; i >= 1; --i) {
    long long l = L - 1, r = R + 1;
    while (l + 1 < r) {
      long long mid = (l + r) >> 1;
      if (p[mid] + s[i] > now)
        l = mid;
      else
        r = mid;
    }
    if (p[r] + s[i] > now || r > n) {
      printf("%lld", i + 1);
      return 0;
    } else
      L = r + 1;
  }
  printf("1");
  return 0;
}
