xs, *_ = ARGF.read.split("\n").map { |e| e.split }
s, *_ = xs.map { |e| e.to_i }

def f(n)
  if n % 2 == 0
    n / 2
  else
    3 * n + 1
  end
end

n = s
a = [s]
i = 2
while true
  x = f(n)
  # p [i, x]
  if a.include? x
    puts i
    exit
  end
  a << x
  n = x
  i += 1
end
