#include <bits/stdc++.h>
using namespace std;
long long n, k, i, j, a[200005], b[200005], x, y, s, nr = 1, u, o, m;
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  s = a[k] + b[1];
  o = n;
  for (i = 1; i <= n; i++) {
    if (a[i] + b[o] > s)
      nr++;
    else
      o--;
  }
  cout << nr;
}
