#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

ll nextLong() { ll x; scanf("%lld", &x); return x;}

map<pair<int,ll>, ll> memo;

int N;
ll A[55];

ll f(const int n, const ll X) {
  if (memo.count({n, X}) > 0) {
    return memo[{n, X}];
  }
  ll res = 0;
  if (n + 1 == N) {
    res = 1;
    return memo[{n, X}] = res;
  }
  ll r = X % A[n+1];
  res += f(n+1, X - r);
  if (r != 0) {
    res += f(n+1, X  + A[n+1] - r);
  }

  return memo[{n, X}] = res;
}

int main2() {
  N = nextLong();
  ll X = nextLong();
  REP(i, N) A[i] = nextLong();

  ll ans = f(0, X);
  cout << ans << endl;
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rrep(i,n) for(int i=((n)-1);i>=0;--i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
#define mod 1000000007
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    string s;
    cin>>s;
    int cnt=0;
    rep(i,s.size()){
        if(s[i]=='Z'&&s[i+1]=='O'&&s[i+2]=='N'&&s[i+3]=='e') cnt++;
    }
    cout<<cnt;
}