W = int(input())
D = int(input())
S = 0

for i in reversed(range(1,D+1)):
    S = W//(i**2)
    W -= S

print(S)