fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); println!( "{}", match s.contains('x') { true => 2u64.pow(32) - s[1..].trim().parse::().unwrap(), _ => s.trim().parse().unwrap(), } ); }