main = do n <- readLn let ans = (length . takeWhile (/= 1) . iterate (\x -> if odd x then x+1 else div x 2)) n print ans