main :: IO () main = do a <- readLn b <- readLn c <- readLn print $ solve a b c solve :: Integer -> Integer -> Integer -> Integer solve a b c = div (abs a + c - 1) c + d + div (abs b + c - 1) c + e where d = if a /= 0 then 1 else 0 e = if b < 0 then 1 + if a == 0 then 1 else 0 else 0