#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, r;
  cin >> n >> r;
  long long val;
  vector<long long> vec1;
  vector<long long> vec2;
  for (int i = 0; i < n; ++i) {
    cin >> val;
    vec1.push_back(val);
  }
  for (int i = 0; i < n; ++i) {
    cin >> val;
    vec2.push_back(val);
  }
  long long max = vec1[r - 1] + vec2[0];
  long long result = 1;
  long long start_s = r - 2;
  long long start_p = 0, count_pass = 0;
  for (int i = start_s; i >= 0;) {
    long long temp = vec1[i] + vec2[start_p];
    if (temp <= max) {
      count_pass += 1;
      --i;
      start_p += 1;
    } else {
      start_p += 1;
      if (start_p >= n) break;
    }
  }
  result += ((r - 1) - count_pass);
  cout << result << endl;
  return 0;
}
