#include <bits/stdc++.h>
using namespace std;
const int Max = 1e6;
const int Max2 = 1e8 + 5;
long a[Max];
long b[Max];
int c[Max];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  long ra = a[m - 1] + b[0];
  int rank = m;
  int j = 0;
  for (int i = m - 2; i >= 0; i--) {
    while ((a[i] + b[j]) > ra) {
      j++;
    }
    if (j < n) {
      rank--;
      j++;
    } else
      break;
  }
  cout << rank << "\n";
  return 0;
}
