#include using namespace std; using ll = long long; using Graph = vector>; long long primeNumber(long long x) { bool fire = true; for(int i = 2; i <= sqrt(x); i++) { if(x % i == 0) { fire = false; } } return fire; } int main() { long long A,B; cin >> A >> B; long long ans = 0; for(int i = 1; i <= sqrt(A); i++) { if(A % i == 0) { if(i % B == 0) { ans++; } if(A / i != i) { if((A/i) % B == 0) { ans++; } } } } cout << ans << endl; }