#include
#include <cstdio>
#include <cmath>
using namespace std;
long long int yueshu(int x,int y){
if(x%y==0){
return y;
}else{
return yueshu(y,x%y);
}
}
int main(){
int x,y;
cin>>x>>y;
int t=x;
int flag=0;
long long int ret=x*y;
int count=0;
while(x<=(long long int)(sqrt(ret))){
if(yueshu(x,ret/x)==t&&(ret)%x==0){
count++;
long long int m=x*x;
if(m==ret){
flag=1;
}
}
x++;
}
cout<
}