fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim(); println!( "{}", match s { "? 3 2" | "2 3 ?" => "1", "? 2 3" | "3 2 ?" => "4", "2 ? 3" | "3 ? 2" => "14", _ => unreachable!(), } ); }