#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} template<typename T> vector<T> compress(vector<T> v){ sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); return v; } template<typename T> map<T, Int> dict(const vector<T> &v){ map<T, Int> res; for(Int i=0;i<(Int)v.size();i++) res[v[i]]=i; return res; } //INSERT ABOVE HERE signed main(){ Int n,x; cin>>n>>x; x++; Int ans=0; vector<Int> vs; for(Int i=1;i*i<=x;i++){ if(x%i) continue; vs.emplace_back(i); vs.emplace_back(x/i); } vs=compress(vs); vs.erase(vs.begin()); const Int INF = 1e9+1; vector<vector<Int> > ps(vs.size(),vector<Int>(n+1,1)); for(Int i=0;i<(Int)vs.size();i++){ for(Int j=1;j<=n;j++){ ps[i][j]=ps[i][j-1]*vs[i]; chmin(ps[i][j],INF); } } function<void(Int, Int, Int)> dfs= [&](Int k,Int l,Int b){ // cout<<k<<" "<<l<<" "<<b<<endl; if(k==n){ ans+=b==x; return; } if(b*ps[l][n-k]>x) return; for(Int i=l;i<(Int)vs.size()&&b*vs[i]<=x;i++){ dfs(k+1,i,b*vs[i]); } }; dfs(0,0,1); cout<<ans<<endl; return 0; }