W = int(input()) D = int(input()) for i in range(D, 0, -1): work = W//i**2 W -= work print(work)