import           Data.List                      ( elemIndex )
import           Data.Maybe                     ( fromJust )
 
main :: IO ()
main = do
    x <- readLn :: IO Int
    let l = iterate step x
    print . (+ 4) . fromJust $ elemIndex 4 l
  where
    step :: Int -> Int
    step n | even n    = n `div` 2
           | otherwise = 3 * n + 1