w = int(input()) D = int(input()) for d in range(D, 0, -1): load = w // d ** 2 w -= load print(load)