fn main() { let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); let mut iter = input.split_whitespace(); let mut A: i32 = iter.next().unwrap().parse().unwrap(); let mut B: i32 = iter.next().unwrap().parse().unwrap(); // swap a b if a >b if A > B { let temp = A; A = B; B = temp; } // find biggest 2^a <= A and 2^b <= B let mut a = 1; let mut b = 1; while a * 2 <= A { a *= 2; } while b * 2 <= B { b *= 2; } if a < b { println!("{}", A); } else if a == b { println!("{}", a - 1); } }