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