#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ans[100] = {0}, i = 0, j = 0, k = 0, l = 0, N, x, a[100] = {0},
            max = 0, X;
  cin >> N >> x;
  X = x;
  for (i; i < N; i++) cin >> a[i];
  for (i = 0; i < N; i++) {
    for (j = N - 1; j > i; j--) {
      if (a[j] < a[j - 1]) {
        long long t = a[j];
        a[j] = a[j - 1];
        a[j - 1] = t;
      }
    }
  }
  for (l = 0; l < N; l++) {
    x = X;
    for (i = l; (x - a[i] >= 0) && a[i]; i++) {
      for (j = 0; j < N; j++) {
        if ((x - a[i]) % a[j] == 0) {
          x -= a[i];
          ans[i]++;
          j = N;
        }
      }
    }
    if (x) {
      for (i = 0; i < N; i++)
        if (x % a[i] == 0) {
          ans[i] = 0;
          break;
        }
    }
    for (i = 0; i < N; i++)
      if (ans[i] == 1) k++;
    if (max < k) max = k;
    k = 0;
  }
  cout << max << endl;
  return 0;
}
