import Control.Monad
import Control.Applicative
import Data.List



main :: IO()
main = do
  s <- readLn :: IO Int
  print $ f (s, 1) []


f :: (Int, Int) -> [Int] -> Int
f (a, n) lst
    | a `elem` lst = n
    | even a = f (a `div` 2, n+1) (a:lst)
    | odd a  = f (3 * a + 1, n+1) (a:lst)
