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