#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 101;
const int M = 1e5 + 1;
int a[N];
int dp[N][M];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= n; i++)
    for (int j = 1; j <= m; j++) dp[i][j] = INF;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      dp[i][j] = min(dp[i - 1][j], dp[i - 1][max(0, j - a[i])] + 1);
    }
  }
  printf("%d\n", dp[n][m]);
}
