#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); long long n, k; cin >> n >> k; vector divs; for (long long i = 1; i * i <= n - k; i++) { if ((n - k) % i == 0) { divs.push_back(i); if (i * i != n - k) { divs.push_back((n - k) / i); } } } int ans = 0; for (long long a : divs) { if (n % a == k) { ans++; } } cout << ans << endl; }