#include <bits/stdc++.h>
const long long int M = 1e9 + 7;
using namespace std;
long long int N = 200000;
bool comp(long long int a, long long int b) { return a > b; }
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, h;
  cin >> n >> h;
  long long int* a = new long long int[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int ans = 1;
  for (long long int i = 2; i <= n; i++) {
    sort(a, a + i, comp);
    long long int sum = 0;
    for (long long int j = 0; j < i; j += 2) {
      sum += a[j];
    }
    if (sum <= h) {
      ans = max(ans, i);
    }
  }
  cout << ans << endl;
  return 0;
}
