import qualified Data.Set as Set

f2::Int->Int
f2 n
   |n `mod` 2==0 =n `div` 2
   |otherwise=n*3+1

f::Set.Set Int->Int->Int->Int
f ss p1 n
    |Set.member n ss==True =p1
    |otherwise=f (Set.insert n ss) (p1+1) (f2 n)

main = do
       e<-getLine
       let x=read e::Int
       putStrLn $ show $ f (Set.fromList []) 1 x