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