solve :: Int -> Int -> Int -> Int solve x y l = (d + l - 1) `div` l + t where t | y < 0 = 2 | x /= 0 = 1 | otherwise = 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