-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU w = io.read() d = io.read() for i = d, 2, -1 do p = math.floor(w / (i * i)) w = w - p end print(w)