# verification-helper: PROBLEM https://yukicoder.me/problems/no/847 import sys sys.path.append("../../") def factorization(n: int) -> int: arr, tmp = [], n for i in range(2, int(-(-n ** 0.5 // 1)) + 1): if tmp % i == 0: cnt = 0 while tmp % i == 0: cnt += 1 tmp //= i arr.append([i, cnt]) if tmp != 1: arr.append([tmp, 1]) return arr def dfs(a: list): global ans if len(a) == l: cnt = 1 for i in range(len(a)): cnt *= fac[i][0] ** a[-1 - i] if cnt <= m: ans += 1 return for i in range(num[l - len(a) - 1] + 1): dfs(a + [i]) n, k, m = map(int, input().split()) fac = factorization(n) l = len(fac) num = [-1] * l for i in range(l): fac[i][1] *= k cnt = 0 while fac[i][0] ** cnt <= m and cnt <= fac[i][1]: cnt += 1 num[i] = cnt - 1 ans = 0 dfs([]) print(ans)