#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a);
    b = b >> 1;
    a = (a * a);
  }
  return ans;
}
long long int modInverse(long long int n, long long int m,
                         long long int mod = 1000000007) {
  return power(n, m - 2) % mod;
}
long long int sieve[15000001];
map<long long int, long long int> b;
void factors(long long int num, vector<long long int> &v) {
  if (num <= 1) return;
  if (sieve[num] != 0) {
    v.push_back(sieve[num]);
    factors(num / sieve[num], v);
  } else
    v.push_back(num);
  return;
}
void fact(int n) {
  vector<long long int> v;
  factors(n, v);
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i] != v[i + 1]) b[v[i]]++;
  }
  b[v[v.size() - 1]]++;
}
long long int vk(string s) {
  long long int cnt = 0;
  for (long long int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') cnt++;
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, d;
  cin >> n >> d;
  long long int a[n], b[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) cin >> b[i];
  long long int k = 1, j = n - 1, ans = 0;
  long long int ms = a[d - 1] + b[0];
  for (long long int i = 0; i < n; i++) {
    if (i == d - 1) continue;
    if (a[i] + b[j] <= ms) {
      j--;
    } else {
      ans++;
      k++;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
