#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, d;
  cin >> n >> d;
  vector<long long> s(n), p(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  long long win = s[d - 1] + p[0];
  long long winpos = d - 2;
  for (int i = 1; i < n; i++) {
    if (s[winpos] + p[i] <= win) {
      winpos--;
    }
  }
  cout << winpos + 2;
  return 0;
}
