solve :: Int -> Int -> Int -> Int solve x y l = (d + l - 1) `div` l + t where t = if y < 0 then 1 else 0 + if x /= 0 then 1 else 0 d = abs x + abs y main :: IO () main = do x <- readLn :: IO Int y <- readLn :: IO Int l <- readLn :: IO Int print $ solve x y l