#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, cnt = 0, sum = 0, jjj;
  cin >> a >> b;
  long long c[100000000], d[100000000];
  for (int i = 0; i < a; i++) {
    if (cnt % 2 == 0)
      cin >> c[cnt / 2];
    else
      cin >> d[cnt / 2];
    cnt++;
  }
  jjj = (cnt + 1) / 2;
  for (int i = 0; i < (cnt + 1) / 2; i++) sum += d[i];
  if (sum >= b) {
    sort(d, d + cnt / 2);
    for (int i = 0; i < cnt / 2; i++) {
      sum -= d[i];
      jjj--;
      if (sum < b) {
        cout << jjj + 1;
        system("pause");
        return 0;
      }
    }
  } else {
    sort(c, c + (cnt + 1) / 2);
    while (sum >= b) {
      sum += c[(cnt + 1) / 2];
      jjj++;
    }
    cout << jjj + 1;
  }
  system("pause");
  return 0;
}
