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

loop :: Int -> Int -> Int
loop c n
  | n == 4 || n == 2 || n == 1 = c + 3
  | otherwise = loop (c + 1) (calc n)

main = do
  s <- readLn
  let ans = loop 1 s
  print ans