#include <bits/stdc++.h>
int main() {
  int min[114514], count[114514];
  int i, j, n, x, ans;
  scanf("%d%d", i, x);
  for (n = 0; n < 114514; n++) {
    int a;
    scanf("%d", &a);
    count[n] = a;
  }
  for (i = 0; i < n - 1; i++) {
    for (j = n - 1; j > i; j--) {
      if (count[j - 1] < count[j]) {
        int d = count[j - 1];
        count[j - 1] = count[j];
        count[j] = d;
      }
    }
  }
  for (i = 0; i < n; i++) {
    min[i] = count[i];
  }
  for (ans = 0; min[1] < x; i--) {
    if (min[n - 1] < i) x = x - min[n - 1];
    ans = ans + 1;
  }
  printf("%d", ans);
  return 0;
}
