w=int(input()) d=int(input()) ans=[] for i in range(d,0,-1): ans.append(w//(i**2)) w-=ans[-1] print(ans[-1])