{-# LANGUAGE TupleSections #-}
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Ord 

main :: IO ()
main = readLn >>= print . solve

solve :: Int -> Int
solve 4 = 3
solve 2 = 4
solve 1 = 4
solve s = generate 1 False s
    where
        generate i f p
            | f && p == 4 = i
            | p == 4 = generate (i + 1) True 2
            | odd p = generate (i + 1) f (3 * p + 1)
            | otherwise = generate (i + 1) f (p `div` 2)

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine