#include using namespace std; struct iofast_t { iofast_t() { ios::sync_with_stdio(false); cin.tie(nullptr); } } iofast; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return std::vector(arg, init); else return std::vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } template > T &chmin(T &l, T r, Compare &&f = less()) { return l = min(l, r, f); } template > T &chmax(T &l, T r, Compare &&f = less()) { return l = max(l, r, f); } int main() { int64_t n, k; cin >> n >> k; auto update = vec(uns, n + 1, 0); update[n].push_back(k); for (int i = n; 0 < i; --i) { auto s = vec(uns, 0); for (auto v : update[i]) { s.push_back(v); s.push_back(v / i); } sort(begin(s), end(s)); s.erase(unique(begin(s), end(s)), end(s)); for (auto v : s) { update[i - 1].push_back(v); } } map, int64_t> dp; for (auto v : update[0]) { dp[{ 0, v }] = 0 < v; } for (int i = 1; i <= n; ++i) { for (auto v : update[i]) { dp[{ i, v }] = dp[{ i - 1, v }] + dp[{ i - 1, v / i }]; } } cout << dp[{ n, k }] - 1 << endl; }