#include using namespace std; int main() { int A, B, count = 0; cin >> A >> B; for (int i=1; i*i<= A; i++) { if (A%i!=0) continue; if(i%B==0) count++; if(A/i==i) continue; if(A/i%B==0)count++; } cout << count << endl; return 0; }