#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX;
const long long base = 1e9;
const double PI = acos(-1);
const long long MOD = 1e9 + 7;
const long long N = 1e5 + 10;
void solve();
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
void solve() {
  long long n, d;
  cin >> n >> d;
  long long a[n], b[n];
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; ++i) {
    cin >> b[i];
  }
  long long bada = a[d - 1] + b[0], hehe = 0, haha = 0;
  for (long long i = n - 1; i >= 0; --i) {
    if (i != d - 1) {
      ++hehe;
      while (hehe < n && b[hehe] + a[i] > bada) {
        ++hehe;
      }
      if (hehe < n) {
        ++haha;
      }
    }
  }
  cout << n - haha << "\n";
  return;
}
