#include using namespace std; using ll = long long; using P = pair; using T = tuple; // #include // using namespace atcoder; // using mint = modint1000000007; #define rep(i, n) for(ll i = 0; i < n; i++) //約数列挙ver(1,nも含む) vector divisor(ll n){ vector div; for(ll i=1;i*i<=n;i++){ if(n%i)continue; div.push_back(i); if(i != n/i)div.push_back(n/i); } return div; } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll n,k; cin >> n >> k; vector div = divisor(n-k); ll ans = 0; for(auto d:div) { if( k < d ) ans++; } cout << ans << endl; return 0; }