import Control.Applicative
import Control.Monad

solver :: Int -> Int -> Int
solver 1 c = c
solver n c =
  if even n then
    solver (n `div` 2) (c + 1)
    else
      solver (3 * n + 1) (c + 1)

main :: IO()
main = do
  n <- (read :: String -> Int) <$> getLine
  unless (n == 0) $ do
    print $ solver n 0
    main