wo=int(input()) day=int(input()) e2=0 for i in range(day): wo=wo-e2 e2=wo//(day-i)**2 print(wo)