main :: IO ()
main = do
  [a, b, x] <- map read . words <$> getLine
  print $ solve a b x

solve :: Int -> Int -> Int -> Int
solve a b x = n - m + 1
  where
    m = if a `mod` x == 0 then a `div` x else a `div` x + 1
    n = b `div` x