using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, k) = (c[0], c[1]); var ans = 0; foreach (var a in Divs(n - k)) { if (n % a == k) ++ans; } WriteLine(ans); } static List Divs(long n) { var list = new List(); for (var i = 1L; i * i <= n; ++i) { if (n % i == 0) { list.Add(i); if (i * i < n) list.Add(n / i); } } return list; } }