S = gets.to_i
a = [nil, S]

def f(n)
  if n.odd?
    3 * n + 1
  else
    n / 2
  end
end

2.upto(1000000) do |i|
  a[i] = f(a[i - 1])
  if a[1..(i-1)].any? { |aa| aa == a[i] }
    puts i
    break
  end
end
