#include using namespace std; int COUNT = 0; vector> factorize(int N){ vector> factors; for (int p = 2; p * p < N; ++p){ int count = 0; while ((N % p) == 0){ N /= p; ++count; } if (count > 0) factors.emplace_back(make_pair(p, count)); } if (N > 1) factors.emplace_back(make_pair(N, 1)); return factors; } void dfs(long long cump, int d, const vector> & factors, const int M){ if (cump > M) return; if (d == factors.size()){ ++COUNT; return; } for (int i = 0; i <= factors[d].second and cump <= M; ++i){ dfs(cump, d + 1, factors, M); cump *= factors[d].first; } } int main(){ int N, K, M; cin >> N >> K >> M; vector> factors = factorize(N); for (auto & pk : factors){ pk.second *= K; } dfs(1, 0, factors, M); cout << COUNT << endl; return 0; }