#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, x;
  cin >> N >> x;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  int residue = x;
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (residue >= vec.at(i)) {
      residue -= vec.at(i);
      count++;
    }
  }
  while (residue > 0 && residue >= vec.at(0)) {
    for (int i = 0; i < N; i++) {
      if (residue >= vec.at(i)) {
        residue -= vec.at(i);
      }
    }
  }
  cout << count << endl;
}
