#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, h;
  cin >> n >> h;
  long long int arr[n + 1];
  arr[0] = 0;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  long long int res = 1;
  long long int temp;
  int j, i;
  for (i = 2; i <= n; i++) {
    sort(arr, arr + i + 1);
    temp = 0;
    for (j = i; j >= 0; j = j - 2) {
      temp += arr[j];
    }
    if (temp > h) {
      cout << res << endl;
      return 0;
    } else
      res = i;
  }
  cout << res << endl;
  return 0;
}
