#include #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair P; const int mod = 1000000007; const int INF = 1e18; map res; void prime_factor(int n){ for(int i = 2; i * i <= n; i++){ while(n % i == 0){ ++res[i]; n /= i; } } if(n != 1) res[n]++; } struct S{ int val; map mp; bool operator>(const S &s) const{ return val > s.val; } }; signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n, k, m; cin >> n >> k >> m; prime_factor(n); for(auto &i : res){ i.second *= k; } S s; s.val = 1; priority_queue, greater > q; q.push(s); set st; st.insert(1); while(q.size()){ S now = q.top(); q.pop(); for(auto i : res){ S nxt = now; nxt.val *= i.first; if(nxt.val > m) continue; if(st.count(nxt.val)) continue; if(nxt.mp[i.first] + 1 > i.second) continue; st.insert(nxt.val); nxt.mp[i.first]++; q.push(nxt); } } cout << st.size() << endl; }