s = gets.chomp.to_i

def collatz(n)
  n.even? ? n/2 : 3 * n + 1
end

a = []

a.push(s)

count = 1
loop do
  count += 1
  s = collatz(s)
  if a.include?(s)
    puts count
    exit 0
  end
  a.push(s)
end
