fn main() { let mut input = String::new(); let _ = std::io::stdin().read_line(&mut input); let max: i32 = input.trim().parse().unwrap(); fn pocket(x: i32, count: i32) -> i32 { if x % 2 == 0 { pocket(x / 2, count + 1) } else if x == 1 { count } else { pocket(x / 2 + x % 2, count + 1) } } let result = pocket(max, 0); println!("{}", result); }