#include <bits/stdc++.h>
using namespace std;
int N, D;
int P[200010], S[200010];
int main() {
  scanf("%d%d", &N, &D);
  for (int i = 0; i < N; i++) scanf("%d", &S[i]);
  for (int i = 0; i < N; i++) scanf("%d", &P[i]);
  S[D - 1] = S[D - 1] + P[0];
  int ct = 0;
  for (int i = 0; i < D - 1; i++)
    if (S[i] + P[N - ct - 1] <= S[D - 1]) ct++;
  printf("%d\n", D - ct);
  return 0;
}
