import Data.Int (Int64)

count :: Integral a => a -> a -> a -> a
count a b x = b `div` x - (a - 1) `div` x

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