#include <bits/stdc++.h>
using namespace std;
long long a[200001];
long long b[200001];
int oo = 0x3f3f3f3f;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, d;
  cin >> n >> d;
  d--;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  sort(b, b + n);
  a[d] += b[n - 1];
  int p;
  bool bo = 0;
  for (int i = 0; i < d; i++) {
    a[i] -= a[d];
    if (a[i] <= 0 && bo == 0) {
      p = i;
      bo = 1;
    }
  }
  int sum = 0;
  for (int i = p, j = 1; i < d; i++, j++) {
    long long h = a[d - j];
    int s = n - 2;
    int st = 0, ed = s;
    int res = -1;
    while (st <= ed) {
      int mid = (st + ed) / 2;
      if (h + b[mid] > 0)
        ed = mid - 1;
      else {
        st = mid + 1;
        res = mid;
      }
    }
    if (res != -1) {
      sum++;
      b[res] = oo;
    } else
      break;
  }
  d -= sum;
  cout << ++d;
  return 0;
}
