#include <bits/stdc++.h>
using namespace std;
int n, d, Rank = 1, m = 2;
long long PFRace[200001], PRank[200001];
void input() {
  cin >> n >> d;
  for (int i = 1; i <= n; i++) cin >> PFRace[i];
  for (int i = 1; i <= n; i++) cin >> PRank[i];
}
void process() {
  PFRace[d] += PRank[1];
  for (int i = 1; i < d; i++)
    if (PFRace[d] < PFRace[i]) {
      Rank++;
      PRank[m] = 0;
      m++;
    } else {
      if ((PFRace[i] + PRank[n]) <= PFRace[d]) {
        n--;
      } else {
        Rank++;
      }
    }
}
void output() { cout << Rank; }
int main() {
  input();
  process();
  output();
}
