#include using namespace std; std::ostream &operator<<(std::ostream &dest, __int128_t value) { std::ostream::sentry s(dest); if (s) { __uint128_t tmp = value < 0 ? -value : value; char buffer[128]; char *d = std::end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = std::end(buffer) - d; if (dest.rdbuf()->sputn(d, len) != len) { dest.setstate(std::ios_base::badbit); } } return dest; } __int128 parse(string &s) { __int128 ret = 0; for (int i = 0; i < s.length(); i++) if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0'; return ret; } typedef unsigned long long int ull; map memo[210]; __int128 solve(int N,int K){ if (memo[N].find(K)!=memo[N].end()){ return memo[N][K]; } if (N==0){ return 1; } __int128 res=solve(N-1,K)+solve(N-1,K/N); memo[N][K]=res; return res; } int main(void){ int N,K; cin>>N>>K; __int128 ans=solve(N,K); if (ans>0){ ans--; } cout<