#include <bits/stdc++.h>
using namespace std;
int s[200001], n, d, p[200001];
vector<int> v;
int main() {
  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);
  sort(s + 1, s + n + 1, greater<int>());
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++)
    if (i != d) v.push_back(s[i]);
  sort(v.begin(), v.end(), greater<int>());
  int curl = 1, curr = n - 1;
  int vald = s[d] + p[n];
  int res = 1;
  for (int i = 0; i < (int)v.size(); i++) {
    if (v[i] + p[curl] > vald)
      curr--, res++;
    else
      curl++;
  }
  cout << res;
}
