#include using namespace std; int main() { long long n, k; cin >> n >> k; long long m = n - k; int count = 0; for (long long i = 1; i * i <= m; i++) { if (m % i == 0) { count += (n % i) == k; if (i * i != m) { count += (n % (m / i)) == k; } } } cout << count << '\n'; return 0; }