{-# LANGUAGE BangPatturns #-}
import qualified Data.IntSet as S

main :: IO ()
main = do
  s <- readLn
  print $ solve s

solve :: Int -> Int
solve s = solve' 1 S.empty s

solve' :: Int -> S.IntSet -> Int -> Int
solve' !n !set s
  | s S.member s = n
  | otherwise = solve' (n + 1) set' (f s)
  where
    set' = S.insert s set

f :: Int -> Int
f s
  | even s = s `div` 2
  | otherwise = 3 * s + 1
