#include <bits/stdc++.h>
using namespace std;
struct Event {
  long long st;
  int num;
  Event(long long st, long long num) : st(st), num(num) {}
};
bool operator<(const Event &e1, const Event &e2) { return e1.st > e2.st; }
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  long long b;
  cin >> b;
  vector<Event> evs;
  for (int i = 0; i + 1 < n; i++) {
    int x;
    scanf("%d", &x);
    evs.push_back(Event(x, i));
  }
  sort(evs.begin(), evs.end());
  vector<long long> sum(n, 0);
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + evs[i - 1].st;
  vector<int> where(n, 0);
  for (int i = 0; i + 1 < n; i++) where[evs[i].num] = i;
  for (int i = 0; i + 1 < n; i++) {
    int ind = where[i];
    long long ans;
    if (ind < k - 1)
      ans = sum[k];
    else
      ans = sum[k - 1] + evs[ind].st;
    if (ans > b) {
      printf("%d\n", i + 1);
      return 0;
    }
  }
  printf("%d\n", n);
  return 0;
}
