from math import sqrt n,k,m = map(int,input().split()) def is_small(a): if float(a)*(a+k)*(a+2*k) > 2e18: return False else: return a*(a+k)*(a+2*k) <= n from collections import Counter d = Counter() for a in range(1,10**6+1): if is_small(a): d[a*(a+k)*(a+2*k)] += 1 else: break def check(x): # a(a+k) = x なる a ある? v = int((sqrt(float(k)**2 + 4.0*x) - k)/2) for a in range(max(1,v-3),v+5): if a >= 1 and a*(a+k)==x: return True if a*(a+k) > x: return False return False ans = 0 for x,v in d.items(): if v == m and not check(x): ans += 1 elif v == m-1 and check(x): ans += 1 if m == 1: v = int((sqrt(float(k)**2 + 4.0*x) - k)/2) for a in range(max(1,v-3),v+5): if a*(a+k) > n: break ans += a-1 for x in d: if check(x): ans -= 1 print(ans)