local x = io.read("*l")
local a = io.read("*l")
local b = io.read("*l")
local change = x - a

while true do
    if change -b < 0 then
        break
    end
    change = change - b
end

print(math.ceil(change))