#include using namespace std; int main() { int Ans = 0; long long N, K; cin >> N >> K; long long M = N - K; for (long long i = 1; i * i <= M; i++) { if (M % i == 0 && N % i == K) Ans++; if (M % i == 0 && N % (M / i) == K && i != (M / i)) Ans++; } cout << Ans << endl; }