main = do [l, r, m] <- map read . words <$> getLine putStrLn . show $ solve l r m solve :: Int -> Int -> Int -> Int solve l r m = min (r - l + 1) m