fn main() { let stdin = std::io::read_to_string(std::io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let x: u8 = stdin.next().unwrap().parse().unwrap(); let y: u8 = stdin.next().unwrap().parse().unwrap(); let z: u8 = stdin.next().unwrap().parse().unwrap(); println!("{}", output(solve(x, y, z))); } fn solve(x: u8, y: u8, z: u8) -> u8 { if x + z <= y { x + z } else if y + z <= x { y + z } else { (x + y + z) / 2 } } fn output(ans: u8) -> u8 { ans }