#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, x, a[N];
  cin >> N >> x;
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  int counter = 0;
  for (int i = 0; i < N; i++) {
    if (x >= a[i]) {
      x -= a[i];
      counter++;
    } else
      break;
  }
  bool can = true;
  while (can == true) {
    for (int i = 0; i < N; i++) {
      if (x >= a[0]) {
        x -= a[i];
        counter--;
      } else {
        can = false;
        break;
      }
    }
    cout << counter << endl;
    return 0;
  }
}
