import Control.Applicative
import Control.Monad
main = do
--     ss <- (map read . words) <$> getLine
--     putStrLn $ show (head ss)
--     s <- (read $ (head ss))::Int
--     s <- head ss
    ss <- string2int <$> getLine
    if ss == 0
      then return()
      else do
           (putStrLn $ show ((length $ collats ss)-1))
           main


collats 1 = [1]
collats n
    | even n = n : collats (n `div` 2)
    | odd n = n : collats (n * 3 +1)

-- rInt.hs
rInt :: String -> Int
rInt str = read str :: Int  -- rInt ?????? read Int ?????\?
string2int str = read str :: Int -- string2int ??? string to int ?????\