use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let mut n: usize = itr.next().unwrap().parse().unwrap(); let mut ans = 0; while n != 1 { if n & 1 == 1 { n += 1; ans += 1; } ans += 1; n >>= 1; } println!("{}", ans); }