import Data.List (foldl')
import Data.Function (on)

main :: IO ()
main = do
  s <- read <$> getLine
  let
    f a = if a `mod` 2 == 0 then a `div` 2 else 3 * a + 1
    cs = iterate f s
    step (_, True) _ = ([], True)
    step (ts, _) a = if a `elem` ts then ([], True) else (a : ts, False)
    n = 1 + length $ takeWhile snd $ foldl' step ([], False) cs
  print n
