#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int A, B; cin >> A >> B; int ans = 0; for (int i = 1; i * i <= A; i++) { if (A % i == 0) { ans += i % B == 0; if (A / i != i) ans += (A / i) % B == 0; } } cout << ans << endl; return 0; }