local s = io.read("*n")
local t = {}
t[s] = 1
local cur_idx = 1
local cur_val = s
while true do
  cur_idx = cur_idx + 1
  if cur_val % 2 == 0 then
    cur_val = cur_val / 2
  else
    cur_val = 3 * cur_val + 1
  end
  if(t[cur_val] ~= nil) then
    print(cur_idx)
    break
  end
  t[cur_val] = cur_idx
end
