main = do x<- fmap read getLine y<- fmap read getLine l<- fmap read getLine putStrLn$show$ceiling(abs x/l)+ceiling(abs y/l)+if x/=0 then 1 else 0