#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, d, s[N], p[N], visp[N], ans, fa[N], luogu;
int find(int u) {
  if (u == fa[u]) {
    return fa[u];
  }
  return fa[u] = find(fa[u]);
}
int bs(int l, int r, int u) {
  if (l == r) {
    return l;
  }
  int mid = (l + r) >> 1;
  if (p[mid] <= u) {
    return bs(l, mid, u);
  } else {
    return bs(mid + 1, r, u);
  }
}
void pre() {
  for (int i = 1; i <= n; i++) {
    fa[i] = i;
  }
}
void merge(int u, int v) { fa[find(u)] = find(v); }
int main() {
  scanf("%d", &n);
  scanf("%d", &d);
  pre();
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
  }
  p[1] += s[d];
  for (int i = 1; i < d; i++) {
    int poi = bs(2, n + 1, p[1] - s[i]);
    if (fa[poi] == 0) {
      ans++;
    } else {
      merge(poi, poi + 1);
    }
  }
  printf("%d\n", ans + 1);
  return 0;
}
