package main import ( "fmt" ) func main() { var A, B int fmt.Scan(&A, &B) n := 0 for i := 1; i*i <= A; i++ { if A%i == 0 { if i%B == 0 { n++ } j := A / i if j != i && j%B == 0 { n++ } } } fmt.Println(n) }