#include #include using namespace std; using namespace atcoder; 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(){ long long n, k; cin >> n >> k; n -= k; vector a = divisor(n); long long res = a.size(); for(auto x : a){ if(x < k) res --; else if(x == 1 && k != 0) res--; } cout << res << endl; }