n = gets.to_i
num = Array.new(1+10**7, 0)
num[n] += 1
for i in 2..10**7+1
  if n % 2 == 0
    n /= 2
  else
    n *= 3
    n += 1
  end
  if num[n] == 0
    num[n] += 1
  else
    puts i
    exit
  end
end
