using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); var A = input[0]; var B = input[1]; var count = 0; var sqrt = (int)Math.Sqrt(A); for (int i = 1; i <= sqrt; i++) { if (A % i == 0) { if (i % B == 0) count++; if ((A / i) % B == 0) { count++; if (A / i == sqrt) count--; } } } Console.WriteLine(count); } }