use std::io::*; use std::str::FromStr; use std::cmp::{min, max}; fn read() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") } fn main() { let a: i64 = read(); let b: i64 = read(); let c: i64 = read(); let d = min(a, b); let e = max(a, b) - min(a, b); let f = min(e, c); let g = (c - f) / 2; println!("{}", d + f + g); }