W=int(input()) D=int(input()) L=[] while W >0 and D!=0: L.append(W//(D**2)) W=W-W//(D**2) D-=1 print(L[D-1])