#include <bits/stdc++.h>
using namespace std;
vector<long long> v1;
vector<long long>::iterator upper, lower, it;
vector<vector<long long>> adj(200005);
unordered_map<long long, long long> mp;
void solve() {
  long long n = 0, m = 0, i = 0, j = 0, l = 0, r = 0, x = 0, y = 0, q = 0,
            z = 0, len = 0, k = 0, p = 0;
  long long a[200005] = {0}, b[200005] = {0}, c[200005] = {0}, d[200005] = {0};
  char s[300005], t[300005];
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
  }
  long long ans = 1;
  j = n - 1;
  for (i = 0; i < n; i++) {
    if (i == m - 1) {
      continue;
    }
    a[i] + b[j] > a[m - 1] + b[0] ? ans++ : j--;
  }
  cout << ans;
}
bool imp = false;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  if (imp) cin >> t;
  while (t--) solve();
  return 0;
}
