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

between a b x
 | ra /= 0 && rb /= 0 = qb - qa
 | otherwise = qb - qa + 1
 where
  (qa,ra) = divMod a x
  (qb,rb) = divMod b x