n, k, m = map(int, input().split())


def max2(x):
    y = round((-k + (k**2 + 4*x)**0.5) / 2)
    if y*(y+k) > x:
        y -= 1
    return y


def is_2(x):
    y = max2(x)
    return y*(y+k) == x


big2 = {}
for b in range(3, 100):
    i = 1
    while True:
        x = 1
        for j in range(b):
            x *= i + j * k
        if x > n:
            break
        if x in big2:
            big2[x] += 1
        else:
            big2[x] = 1
        i += 1

count_2 = max2(n)
for i in big2:
    if is_2(i):
        big2[i] += 1
        count_2 -= 1

ans = count_2 if m == 1 else 0
for i in big2.values():
    if i == m:
        ans += 1
print(ans)