import qualified Data.Set as Set

main = do
    s <- read <$> getLine
    print $ solve s (Set.fromList [])

nextCollatz :: Int -> Int
nextCollatz n
    | even n = n `div` 2
    | otherwise = 3 * n + 1

solve :: Int -> Set.Set Int -> Int
solve n set
    | n `Set.member` set = 1
    | otherwise = 1 + solve (nextCollatz n) (Set.insert n set)