#include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) /* divisor(n) 入力:整数 n 出力:nのすべての約数 計算量:O(√n) */ vector divisor(long long n) { vector ret; for (long long i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } sort(ret.begin(), ret.end()); // 昇順に並べる return ret; } int main(){ ll n , k ; cin >> n >> k ; vector a = divisor(n-k) ; if(k!=0) cout << a.size() -1 << endl ; else cout << a.size() << endl ; }