
//
//3 12
//
//1 1 12
//1 12 1
//12 1 1
//
//1 2 6
//1 6 2
//2 1 6
//2 6 1
//6 1 2
//6 2 1
//
//1 3 4
//1 4 3
//3 1 4
//3 4 1
//4 1 3
//4 3 1
//
//2 2 3
//2 3 2
//3 2 2

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
using namespace std;

int n,m;
int sum=0;
void dfs(int cent,int fm)
{

    if(cent==n+1)
    {
        if(fm==1)
            sum++;
        return ;
    }

    for(int i=1;i<=fm;i++)
    {
        if(fm%i==0)
            dfs(cent+1,fm/i);

    }


}

int main()
{

    scanf("%d%d",&n,&m);

    dfs(1,m);
    cout<<sum<<endl;
return 0;

}
