use std::io::{self, BufReader, BufWriter, Read, Write}; fn main() { let stdin = io::stdin(); let mut stdin = BufReader::new(stdin.lock()); let stdout = io::stdout(); let mut stdout = BufWriter::new(stdout.lock()); let mut buf = String::new(); stdin.read_to_string(&mut buf).unwrap(); let n: u32 = buf.trim_end().parse().unwrap(); let mut bn = 1; let mut i = 0; while bn != n { if bn * 2 <= n { i += 1; bn *= 2; } else { i += 1; bn += n - bn; } } writeln!(&mut stdout, "{}", i).unwrap(); }