#[allow(unused_macros)] macro_rules! scan { () => { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().to_string() } }; (;;) => { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().split_whitespace().map(|s| s.to_string()).collect::>() } }; (;;$n:expr) => { { (0..$n).map(|_| scan!()).collect::>() } }; ($t:ty) => { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().parse::<$t>().unwrap() } }; ($($t:ty),*) => { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( $(iter.next().unwrap().parse::<$t>().unwrap(),)* ) } }; ($t:ty;;) => { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|t| t.parse::<$t>().unwrap()) .collect::>() } }; ($t:ty;;$n:expr) => { (0..$n).map(|_| scan!($t;;)).collect::>() }; ($t:ty; $n:expr) => { (0..$n).map(|_| scan!($t) ).collect::>() }; ($($t:ty),*; $n:expr) => { (0..$n).map(|_| scan!($($t),*) ).collect::>() }; } fn main() { let (l, r, m) = scan!(usize, usize, usize); println!("{}", m.min(r - l + 1)); }