#include <bits/stdc++.h>
long long a(long long x, long long *aa, int N, int c) {
  if (x < 0)
    return -1;
  else if (x == 0)
    return c;
  int i, tmp;
  for (i = 0; i < N; i++) {
    tmp = a(x - aa[i], aa, N, c + 1);
    if (tmp != -1) return tmp;
  }
  return -1;
}
int main() {
  int i, N, mini, out = 0;
  long long x, aa[100], mem[100], min;
  scanf("%d%lld", &N, &x);
  for (i = 0; i < N; i++) {
    scanf("%lld", &aa[i]);
    mem[i] = aa[i];
  }
  while (1) {
    for (i = 0, min = INT_MAX; i < N; i++) {
      if (mem[i] < min) {
        min = mem[i];
        mini = i;
      }
    }
    if (min != INT_MAX && min <= x) {
      x -= min;
      mem[mini] = INT_MAX;
      out++;
    } else
      break;
  }
  if (out == 0)
    printf("0\n");
  else {
    int tmp;
    tmp = a(x, aa, N, 0);
    out -= tmp;
    if (tmp == -1 || out < 0)
      printf("0\n");
    else
      printf("%d\n", out);
  }
  return 0;
}
