import Control.Monad main = do [x, y, l] <- replicateM 3 readLn let ans = sum [ (abs x + l - 1) `div` l , (abs y + l - 1) `div` l , if y < 0 then 2 else if x /= 0 then 1 else 0 ] print ans