#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[201800], b[201800];
int wf(int mid, int s) {
  int i, j, k;
  for (i = 0, j = 1, k = 0; i < n && k < mid; i++) {
    if (i != m) {
      if (a[i] + b[j] < s) {
        return -1;
      }
      j++;
      k++;
    }
  }
  j = n - 1;
  while (i < n) {
    if (i != m) {
      if (a[i] + b[j] > s) {
        return 1;
      }
      j--;
    }
    i++;
  }
  return 0;
}
void solve() {
  int i, j, k;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }
  int s = a[m] + b[0];
  int x = 0, y = n - 1;
  int mid;
  while (x < y) {
    mid = (x + y) / 2;
    int v = wf(mid, s);
    if (v <= 0) {
      y = mid;
    } else {
      x = mid + 1;
    }
  }
  printf("%d\n", x + 1);
}
int main() {
  while (scanf("%d %d", &n, &m) != EOF) {
    m--;
    solve();
  }
  return 0;
}
