s = gets.chomp.split.map(&:to_i).first

def func1(integer)
  return integer/2 if integer % 2 == 0
  return 3*integer + 1
end

count = 2
a = [s]

loop do
  s = func1(s)
  a << s
  break if a.count(s) == 2
  count += 1
end

puts count

