w=int(input()) d=int(input()) for i in reversed(range(1,d+1)): y=w//(i*i) w-=y print(y)