#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  long long int n, r;
  cin >> n >> r;
  vector<long long int> a(n + 1), b(n + 1);
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  for (long long int i = 1; i <= n; i++) cin >> b[i];
  long long int val = a[r] + b[1];
  long long int cnt = 1;
  long long int p1 = 1;
  long long int p2 = n + 1;
  long long int cur = 1;
  while (p1 < p2 && cur < r) {
    long long int x = a[cur] + b[p2 - 1];
    long long int y = a[cur] + b[p1 + 1];
    if (x <= val)
      p2--;
    else if (x > val)
      p1++, cnt++;
    cur++;
  }
  cout << cnt << "\n";
}
