s = gets.to_i

def fn (n)
  if n.even?
    n/2
  else
    3*n+1
  end
end

m = 0
a = Array.new(1000001, 0)
a[1] = s
2.upto(1000000) do |i|
  result = fn(a[i-1])
  if a.include?(result)
    m = i
    break
  else
    a[i] = result
  end
end

puts m