#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 5;
int s[N], p[N];
int main() {
  int n, d, t;
  cin >> n >> d;
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  t = n;
  s[d] += p[1] + 1;
  for (int i = 1; i <= n; i++)
    if (s[i] + p[t] < s[d]) t--;
  cout << t;
}
