import Data.List
main = do
    s <- readLn :: IO Int
    print $ solve [s]
        
solve :: [Int] -> Int
--solve path@(x:xs) = if next `elem` path then findIndex (==next) path else solve (next:path) 
solve path@(x:xs) = if next `elem` path then length path + 1 else solve (next:path) 
    where
        isEven = even x
        next = if isEven then x `div` 2 else 3*x + 1