#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n >> d;
  int A[n];
  int B[n];
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> B[i];
  }
  A[d - 1] += B[0];
  int ans = A[d - 1];
  int j = 1 + n - d;
  int key = n - 1;
  for (int i = 0; i < d - 1; i++) {
    if (A[i] + B[key] > ans) {
      A[i] += B[j];
      j++;
      continue;
    } else {
      A[i] += B[key];
      key--;
      continue;
    }
  }
  int i;
  sort(A, A + n);
  reverse(A, A + n);
  int rank[n];
  for (i = 0; i < n; i++) {
    rank[i] = i + 1;
  }
  for (i = 1; i < n; i++) {
    if (A[i] == A[i - 1]) {
      rank[i] = rank[i - 1];
    }
  }
  for (i = 0; i < n; i++) {
    if (A[i] == ans) {
      cout << rank[i];
      break;
    }
  }
  return 0;
}
