#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  int s = a[m - 1] + b[0];
  int k = 0, l = n;
  for (int i = 0; i < n; i++) {
    if (i == m - 1) continue;
    if (a[i] + b[l - 1] > s)
      k++;
    else
      l--;
  }
  cout << k + 1;
}
