main = do
  [a, b, x] <- map read . words <$> getLine :: IO [Int]
  if b - a /= 0 && b >= x then if mod a x == 0 || mod b x == 0 || mod (b - 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
