#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i divisor(ll N){ vector res; for(ll i = 1LL; i*i <= N; ++i){ if(N % i != 0LL) continue; res.emplace_back(i); if(i*i != N) res.emplace_back(N/i); } sort(res.begin(), res.end()); return res; } int main(){ ll N, K; cin >> N >> K; vector div = divisor(N-K); int ans = 0; for(ll &d : div){ if(d > K) ans++; } cout << ans << endl; return 0; }