import Control.Monad main = do [x,y,l] <- replicateM 3 readLn putStrLn . show $ (ceiling $ (abs x) / l) + (ceiling $ (abs y) / l) + (turnCnt x y) turnCnt x y | x == 0 && y >= 0 = 0 | x /= 0 && y >= 0 = 1 | otherwise = 2