solve a b x =
  if a `mod` x == 0
    then (b `div` x) - (a `div` x) + 1
    else (b `div` x) - (a `div` x)

main = do
  line <- getLine
  let xs = words line
      [a, b, x] = fmap (read :: String -> Int) xs in
    putStrLn $ show $ solve a b x
