#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, d;
  cin >> n >> d;
  long long m = d - 2, k = 0;
  vector<long long> curPoint(n), point(n);
  for (long long i = 0; i < n; ++i) cin >> curPoint[i];
  for (long long i = 0; i < n; ++i) cin >> point[i];
  curPoint[d - 1] += point[0];
  for (long long i = 1; i < n && m >= 0; ++i)
    if (curPoint[m] + point[i] <= curPoint[d - 1]) ++k, --m;
  cout << d - k << '\n';
  return 0;
}
