s = gets.chomp.to_i

def fn(n)
  if n % 2 == 0
    n / 2
  else
    3 * n + 1
  end
end

h = [[s, 1]].to_h
k = { 1 => s }

i = 1
while true
  i = i + 1

  ai = fn(k[i - 1])
  if h[ai].nil?
    k[i] = ai
    h[ai] = i
  else
    print(i)
    break
  end
end
