#include <bits/stdc++.h>
const int N = 110;
int a[N], n, m;
inline bool check(int x) {
  int tot = m;
  for (int i = 1; i <= n; ++i) {
    if (tot >= a[i]) {
      tot -= a[i];
      x--;
    }
  }
  if (x <= 0)
    return true;
  else
    return false;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  std::sort(a + 1, a + n + 1);
  int L = 0, R = n;
  while (L < R) {
    printf("%d %d\n", L, R);
    int mid = (L + R + 1) >> 1;
    if (check(mid)) {
      L = mid;
    } else {
      R = mid - 1;
    }
  }
  printf("%d\n", L);
}
