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 = generate 1
    where
        generate i p
            | p == 4 || p == 2 || p == 1 =  i + 3
            | odd p = generate (i + 1) $ 3 * p + 1
            | otherwise = generate (i + 1) $ 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