#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0); cout.tie(0);
  ios::sync_with_stdio(false);
  int N, K;
  cin >> N >> K;
  vector<int> A(N);
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  for(int i = 0; i < N; i++) {
    if(A[i] <= K) {
      K -= A[i];
    } else {
      cout << i << ' ' << K << '\n';
      return 0;
    }
  }
  cout << N << ' ' << K << '\n';
  return 0;
}