// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define forn(i, s, n)  for(ll i=(ll)s; i<(ll)(n); i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define pss pair<string, string>
#define ull unsigned long long int
#define lld long double
#define F first
#define S second
#define PI 3.141592653589793238
#define prec(n) fixed<<setprecision(n)
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define itsval(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); itval(_it, args); }
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

void itval(istream_iterator<string> it) {}
template<typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    itval(++it, args...);
}
const ll MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {cout << x << "\n";}
template <typename T>
inline void printvec(T x) {for (auto a : x)cout << a << ' '; cout << '\n';}
// -----------------------------------------------------------------------

struct custom {
    bool operator()(const pair<ll, pll> &p1, const pair<ll, pll> &p2)const {
        return p1.F < p2.F;
    }
};

// Calculate a^b % MOD -------------------------------------------------
ll get_pow(ll a, ll b, ll M = MOD) {
    ll res = 1;
    while (b) {
        if (b & 1) res = (res * a) % M;
        a = (a * a) % M;
        b >>= 1;
    }
    return res;
}
// ---------------------------------------------------------------------
const ll N = 2e5 + 5, inf = 2e18;

void solve()
{
    ll a[2][2];
    forn(i, 0, 2)
    forn(j, 0, 2)
    cin >> a[i][j];
    ll ans = -inf;
    forn(i, 0, 2)
    {
        forn(j, 0, 2)
        ans = max(ans, a[0][i] - a[1][j]);
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int test = 1;
    clock_t z = clock();
//   cin >> test;

    forn(tes, 0, test)
    {
        solve();
    }
    debug("Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define INF ((int64_t)1e16)

int main()
{
    int N;
    int64_t X;
    cin >> N >> X;
    vector<int64_t> A(N);
    for (auto &a : A)
    {
        cin >> a;
    }

    vector<int64_t> cnt(N);
    for (int i = 0; i < N; i++)
    {
        int j = N - 1 - i;
        cnt.at(j) = X / A.at(j);
        X %= A.at(j);
    }
    vector<int64_t> limit(N);
    for (int i = 0; i < N - 1; i++)
    {
        limit.at(i) = A.at(i + 1) / A.at(i);
    }
    limit.at(N - 1) = INF / A.at(N - 1);

    vector<int64_t> ans1(N, 0);
    vector<int64_t> ans2(N, 0);
    if (cnt.at(0) > 0)
    {
        ans1.at(0) = 1;
    }
    ans2.at(0) = 1;
    for (int i = 1; i < N; i++)
    {
        ans1.at(i) = ans1.at(i - 1);
        ans2.at(i) = ans2.at(i - 1);
        if (cnt.at(i) + 1 < limit.at(i))
        {
            ans2.at(i) += ans1.at(i - 1);
        }
        if (cnt.at(i) > 0)
        {
            ans1.at(i) += ans2.at(i - 1);
        }
    }

    cout << ans2.at(N - 1) << endl;

    return 0;
}