import java.util.*; public class Main { static int m; static int[] keys; static long[] values; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long k = sc.nextInt(); m = sc.nextInt(); HashMap map = new HashMap<>(); for (int i = 2; i <= Math.sqrt(n); i++) { while (n % i == 0) { if (map.containsKey(i)) { map.put(i, map.get(i) + 1); } else { map.put(i, 1); } n /= i; } } if (n != 1) { if (map.containsKey(n)) { map.put(n, map.get(n) + 1); } else { map.put(n, 1); } } keys = new int[map.size()]; values = new long[map.size()]; int idx = 0; for (Map.Entry entry : map.entrySet()) { keys[idx] = entry.getKey(); values[idx] = entry.getValue() * k; idx++; } System.out.println(search(0, 1)); } static long search(int idx, long v) { if (idx >= keys.length) { return 1; } long ans = 0; long count = 0; while (v <= m && count <= values[idx]) { ans += search(idx + 1, v); v *= keys[idx]; count++; } return ans; } }