#include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 10;
int n, d;
int r[N], v[N];
int mx, ans = 1;
int read() {
  int sum = 0;
  char c = getchar(), flag = ' ';
  while (c < '0' || c > '9') flag = c, c = getchar();
  while (c >= '0' && c <= '9') sum = sum * 10 + c - '0', c = getchar();
  if (flag == '-') sum *= -1;
  return sum;
}
int main() {
  n = read(), d = read();
  for (int i = 1; i <= n; i++) r[i] = read();
  for (int i = 1; i <= n; i++) v[i] = read();
  mx = r[d] + v[1];
  for (int i = 1, j = n; j > 1; i++, j--)
    while (i <= n && (i == d || r[i] + v[j] > mx)) ans += (i != d), i++;
  if (ans)
    cout << ans;
  else
    puts("fuck");
  return 0;
}
