fn :: Int -> Int
fn x
    | even x = x `div` 2
    | otherwise = 3 * x + 1

solve :: [Int] -> Int
solve x
    | next `elem` x = 1 + length x
    | otherwise = solve (x ++ [next])
    where next = fn $ last x

main :: IO ()
main = do
    s <- readLn :: IO Int
    print $ solve [s]