#include <bits/stdc++.h>
using namespace std;
int A[200010], B[200010];
int main() {
  int i, n, m;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &B[i]);
  }
  int a = n, ans = 0;
  for (i = 1; i < m; i++) {
    if (A[i] + B[a] <= A[m] + B[1]) {
      ans++;
      a--;
    }
  }
  cout << m - ans << endl;
  return 0;
}
