#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
const double pi = acos(-1.0);
int main(void) {
  long long n, x;
  cin >> n >> x;
  vector<long long> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  long long ans = 0, i = 0;
  sort(a.begin(), a.end());
  for (int i = 0; i < (n); ++i) {
    if (x < a[i]) break;
    if (x % a[i] == 0) {
      ++ans;
      x -= a[i];
    }
  }
  cout << ans << endl;
  return 0;
}
