import Control.Applicative
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Strict as IM

main :: IO ()
main = solve <$> readLn >>= print

solve :: Int -> Int
solve s = f IM.empty 1 s
  where
    f mp i n = let n' = if even n then n `div` 2 else n * 3 + 1
               in case IM.lookup n mp of
                   Nothing -> f (IM.insert n i mp) (i + 1) n'
                   Just _ -> i
