main = do
  [a, b, x] <- map read . words <$> getLine :: IO [Int]
  if b - a  /= 0 then if mod a x == 0 then print $ (+1) $ (b - a) `div` x
                                      else print $ (b - a) `div` x
                 else if mod a x == 0 then print 1
                                      else print 0