local s = io.read("*n")
local t = {}
t[s] = 1
local p = 1
local cur = s
while true do
  p = p + 1
  local nxt = cur % 2 == 0 and cur // 2 or 3 * cur + 1
  if t[nxt] then
    print(p)
    break
  else
    t[nxt] = p
  end
  cur = nxt
end
