#include <bits/stdc++.h>
const long long maxn = 3e5 + 10;
using namespace std;
vector<long long> arr, p;
long long D, N;
signed main() {
  ios::sync_with_stdio(false);
  cin >> N >> D;
  long long mx;
  for (register long long i = 1; i <= N; ++i) {
    long long x;
    cin >> x;
    if (i == D) {
      mx = x;
    } else {
      arr.push_back(x);
    }
  }
  for (register long long i = 1; i <= N; ++i) {
    long long x;
    cin >> x;
    if (i == 1) {
      mx += x;
    } else {
      p.push_back(x);
    }
  }
  long long al = 0, ar = (long long)(arr.size()) - 1, pl = 0, pr = ar, ans = 0;
  while (al <= ar) {
    if (arr[al] + p[pr] <= mx) {
      ans++;
      al++, pr--;
    } else {
      al++, pl++;
    }
  }
  cout << N - ans << endl;
  return 0;
}
