from collections import defaultdict import sys sys.setrecursionlimit(10**6) def factorization(n): arr = defaultdict(int) for i in range(2, int(-(-n**0.5//1))+1): while n % i == 0: arr[i] += 1 n //= i if n != 1: arr[n] += 1 return arr def dfs(lst): global s num = 1 for i in range(len(lst)): num *= keys[i]**lst[i] if num <= m: s.add(num) if lst[i] < values[i]: lst[i] += 1 dfs(lst) lst[i] -= 1 else: return 0 n, k, m = map(int, input().split()) if n == 1: print(1) exit() f = factorization(n) keys = list(f.keys()) values = [v*k for v in f.values()] s = set() dfs([0]*len(keys)) print(len(s))