from heapq import heappush as hp, heappop as hpp def prf(m): pf = {} for i in range(2, int(m**0.5)+1): while m % i == 0: pf[i] = pf.get(i, 0)+1 m //= i if m > 1: pf[m] = 1 return pf def calc(Num, L): res = 1 for n, l in zip(Num, L): res *= pow(l, n) return res N, K, M = map(int, input().split()) Pf = prf(N) if not Pf: print(1) else: Pkey, Pval = map(list, zip(*Pf.items())) pl = len(Pkey) cnt = 0 Q = [(1, tuple(0 for _ in range(pl)))] used = set() while Q: x, pp = hpp(Q) if x > M: break if any(a*K < b for a, b in zip(Pval, pp)) or pp in used: continue used.add(pp) cnt += 1 for i in range(pl): lp = list(pp) lp[i] += 1 hp(Q, (calc(lp, Pkey), tuple(lp))) print(cnt)