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