#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9, mod = 1e9 + 7;
int dX[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dY[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
long long n, x[N], y[N], d, ans, r;
int main() {
  scanf("%lld%lld ", &n, &d);
  for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
  for (int i = 0; i < n; i++) scanf("%lld", &y[i]);
  ans = x[d - 1] + y[0];
  int j = n - 1;
  r = d;
  for (int i = 0, j = n - 1; i < d - 1; i++) {
    if (x[i] + y[j] <= ans) {
      r--;
      j--;
    }
  }
  cout << r;
}
