#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100111;
const int INF = 0x7f7f7f7f;
int cases;
long long num[MAXN], sum[MAXN];
int main() {
  int n, k;
  long long x, b;
  scanf("%d%d%lld", &n, &k, &b);
  for (int i = 1; i < n; i++) {
    scanf("%lld", &num[i]);
    sum[i] = num[i];
  }
  scanf("%lld", &x);
  sort(sum + 1, sum + n, greater<int>());
  long long tmp = sum[k];
  for (int i = 2; i <= k; i++) {
    sum[i] += sum[i - 1];
  }
  if (sum[k] <= b) {
    printf("%d\n", n);
  } else {
    for (int i = 1; i < n; i++) {
      if (num[i] >= tmp || ((num[i] < tmp) && (sum[k] - tmp + num[i] > b))) {
        printf("%d\n", i);
        break;
      }
    }
  }
}
