fn main() { let mut xx = String::new(); std::io::stdin().read_line(&mut xx).ok(); let xx: Vec = xx.split_whitespace().flat_map(str::parse).collect(); if xx[2] >= xx[1] { println!("{}", xx[2] - 2); } else if xx[2] >= xx[0] { println!("{}", xx[2] - 1); } else { println!("{}", xx[2]); } }