#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
long long n, k, b, sum, a[N], v[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> b;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v[i] = a[i];
  }
  sort(v, v + n - 1);
  reverse(v, v + n - 1);
  for (int i = 0; i < k; i++) sum += v[i];
  if (b >= sum) return cout << n, 0;
  for (int i = 0; i < n; i++)
    if (sum + a[i] - v[k - 1] > b) return cout << i + 1, 0;
  cout << n;
}
