s = gets.to_i
dp = Array.new(1000_000 + 30)
dp[1] = s
used = {}

ans = (2 .. 1_000_000).find do |i|
  v = dp[i] = dp[i - 1].odd? ? (dp[i - 1] * 3 + 1) : (dp[i - 1] / 2)
  
  found = used[v]
  used[v] = true if !found

  found
end
puts ans
