#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, i, x, a, j, y;
  cin >> n >> k;
  long long arr[n], arr1[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (i = 0; i < n; i++) {
    cin >> arr1[i];
  }
  x = arr[k - 1] + arr1[0];
  i = 0;
  while (arr[i] > x) {
    i++;
  }
  a = i;
  vector<int> ve;
  ve.push_back(x);
  j = n - 1;
  while (a < n) {
    y = arr[a] + arr1[j];
    if (a == k - 1) {
      a++;
      continue;
    }
    ve.push_back(y);
    a++;
    j--;
  }
  sort(ve.begin(), ve.end());
  for (j = ve.size() - 1; j >= 0; j--) {
    if (ve[j] == x) break;
  }
  j = ve.size() - j - 1;
  cout << i + j + 1;
}
