W = int(input()) D = int(input()) i = 0 for value in D-1: w = W // (D - i) ** 2 W = W -w i += 1 print(W)