#include using namespace std; using ll = long long; vector divisor(long long n) { vector ret; for (long long i = 1; i <= n; i++) { if (n % i == 0) { ret.push_back(n / i); } } return ret; } int main(){ ll N,K; cin >> N >> K; vector v = divisor(N-K); sort(v.begin(),v.end()); cout << v.end() - upper_bound(v.begin(),v.end(),K) << endl; }