x, y, r = io.read("*n", "*n", "*n") cmd = 0 if(x == 0) then if(y < 0) then cmd = 2 end elseif(y == 0) then cmd = 1 else if(0 < y) then cmd = 1 else cmd = 2 end end x, y = math.abs(x), math.abs(y) cmd = cmd + math.floor(x / r) + math.floor(y / r) if(0 < x % r) then cmd = cmd + 1 end if(0 < y % r) then cmd = cmd + 1 end print(cmd)