fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let result = (0..60).rev().filter(|&i| ((n >> i) & 1) == 1).map(|i| 1usize << i).nth(0).unwrap(); println!("{}", result); }