funcCollatz :: Int -> Int
funcCollatz n = case n `mod` 2 of 0 -> n `div` 2
                                  1 -> 3 * n + 1

collatz :: [Int] -> [Int]
collatz (x:xs) = [funcCollatz x] ++ (x:xs)

loop :: Int -> [Int] -> Int
loop k (x:xs) = case dropWhile (/=(funcCollatz x)) xs of []        -> loop (k+1) (collatz (x:xs))
                                                         otherwise -> k+1

main :: IO()
main = getLine >>= \s -> print $ loop 1 [(read s :: Int)]