import Control.Monad moveBot [x,y,l] | y >= 0 && x == 0 = (y + l - 1) `div` l | y >= 0 && x /= 0 = (y + l - 1) `div` l + ((abs x) + l - 1) `div` l + 1 | otherwise = ((abs y) + l - 1) `div` l + ((abs x) + l - 1) `div` l + 2 main = do xs <- map (read :: String -> Int) <$> replicateM 3 getLine print $ moveBot xs