import Control.Applicative
import Control.Monad
import Data.List

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