#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int dp[110][100000];
  memset(dp, 0, sizeof(dp));
  int N;
  cin >> N;
  int x;
  cin >> x;
  int a[100];
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }
  int cnt = 0;
  sort(a, a + N);
  int maxx = x / a[0];
  int nx;
  for (int i = 1; i < N; ++i) {
    for (int j = 0; j <= x; ++j) {
      if (j < a[i]) {
        dp[i + 1][j] = dp[i][j];
      } else {
        dp[i + 1][j] = max(dp[i][j], dp[i + 1][j - a[i]] + 1);
      }
    }
  }
  cout << dp[N][x] << endl;
}
