#include <bits/stdc++.h>
std::istream& operator>>(std::istream& input, __int128_t& value) {
  long long tmp;
  input >> tmp;
  value = tmp;
  return input;
}
std::ostream& operator<<(std::ostream& output, const __int128_t value) {
  output << (long long)value;
  return output;
}
const int MAX_N = 102;
int N;
__int128_t x, a[MAX_N];
int main(int argc, char** argv) {
  std::cin >> N >> x;
  __int128_t sum = 0;
  for (int i = 1; i <= N; i++) {
    std::cin >> a[i];
    sum += a[i];
  }
  std::cout << sum << " " << x << std::endl;
  if (sum == x) {
    std::cout << N << std::endl;
    return 0;
  } else if (sum < x) {
    std::cout << N - 1 << std::endl;
    return 0;
  }
  std::sort(a + 1, a + 1 + N);
  int ret = 0;
  for (int i = 1; i <= N; i++) {
    if (a[i] <= x) {
      ret++;
      x -= a[i];
    } else {
      break;
    }
  }
  std::cout << ret << std::endl;
  return 0;
}
