#include #include using namespace std; using namespace atcoder; using ll = int_fast64_t; using ull = uint_fast64_t; using mint = modint998244353; constexpr ll INF = 1ll << 60; #define iscontain(container, value) (find(container.begin(), container.end(), value) != container.end()) template void printelem(const T& container, const D& divide){ for(const auto& i : container) cout << i << divide; cout << endl; } template void printelem(const T& container) { printelem(container, ", "); } template T input(){ T ret; cin >> ret; return ret; } int main(){ //インプット ll N, K; cin >> N >> K; if(K == 0){ if(N == 1) cout << 1; else cout << 2; return 0; } ll ans = 0; for(ll i = 1; i*i <= N; i++){ if((N-K)%i == 0){ if(N%i == K) ans++; if(i*i != N-K && N%((N-K)/i) == K) ans++; } } //アウトプット cout << ans; return 0; }