fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: Vec = s.split_whitespace().flat_map(str::parse).collect(); let mut a = 0; for i in 1.. { if i * i > n[0] { break; } if n[0] % i == 0 { let j = n[0] / i; a += if i % n[1] == 0 { 1 } else { 0 }; a += if i != j && j % n[1] == 0 { 1 } else { 0 }; } } println!("{a}") }