#include using namespace std; long long int n, k, m; int main(){ cin >> n >> k >> m; long long int a = 1; multiset S; long long int res = 0; while (a*(a + k) <= n){ long long int cur = a*(a + k); for (long long int i = 1; cur <= n; cur *= (a + k*i)){ S.insert(cur); ++i; if (S.count(cur) == m){ ++res; } if (S.count(cur) > m){ --res; } } ++a; } cout << res << endl; }