main :: IO ()
main = do
  n <- readLn
  if n == 0
    then return ()
    else do
      let ans = counter' n
      putStrLn $ show ans
      main


counter :: Int -> Int -> Int
counter 1 count = count
counter n count
  | n `mod` 2 == 0 = counter (div n 2) (count+1)
  |otherwise = counter (n*3+1) (count+1)

counter' :: Int -> Int
counter' n = counter n 0