#include #include int main() { long long int n, k, m; scanf("%lld %lld %lld", &n, &k, &m); if (n == 1) { printf("1\n"); return 0; } long long int p[100005], count[100005]; long long int i, l = 0, j; while (n > 1) { for (i = 2; i <= sqrt(n); i++) if (n % i == 0) break; if (n % i == 0) { p[l] = i; count[l] = 0; while (n % i == 0) { count[l]++; n /= i; } l++; } else { p[l] = n; count[l] = 1; l++; n /= n; } } for (i = 0; i < l; i++) count[i] *= k; long long int ans = 0; long long int ii[100005], v[100005]; for (i = 0; i < l; i++) ii[i] = 0; for (i = 0; i < l; i++) v[i] = 1; long long int now; for (;;) { now = 1; for (i = 0; i < l; i++) { now *= v[i]; if (now > m) break; } if (i == l && now <= m) { ans++; ii[l - 1]++; v[l - 1] *= p[l - 1]; } else { if (i == 0) break; for (; i < l; i++) { ii[i] = 0; v[i] = 1; } i -= 2; ii[i]++; v[i] *= p[i]; } for (i = l - 1; i > 0; i--) { if (ii[i] > count[i]) { for (j = i; j < l; j++) { ii[j] = 0; v[j] = 1; } ii[i - 1]++; v[i - 1] *= p[i - 1]; } } if (ii[0] > count[0]) break; } printf("%lld\n", ans); return 0; }