s = gets.to_i

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

before = s
h = []

h[s] = 1

1000000.times do |i|
  curr = f(before)
  if(h[curr])
    puts i + 2
    exit
  else
    h[curr] = 1
  end

  before = curr
end
