main = interact $ show . solve . map (read :: String -> Int) . words solve (l:r:m:_) = min (length [l..r]) m