using System; using System.Collections.Generic; namespace test { static class Program { static void Main() { string[] a = Console.ReadLine().Split(' '); long b = long.Parse(a[0]); long c = long.Parse(a[1]); if (b % c != 0) { Console.WriteLine(0); } else { long d = b / c; var e = CDs(d); long kosuu = 1; foreach (var item in e) { kosuu *= item.Value + 1; } Console.WriteLine(kosuu); } } static Dictionary CDs(long n) { Dictionary CDs = new Dictionary(); long copy = n; for (long i = 2; i <= Math.Sqrt(copy) + 1; i++) { while (n % i == 0) { if (CDs.ContainsKey(i)) { CDs[i]++; } else { CDs.Add(i, 1); } n /= i; } } if (n != 1) { CDs.Add(n, 1); } return CDs; } } }