s = gets.chomp.to_i

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

hash = {}
temp = s

for i in 1..1000000 do
  if !hash.key?(temp.to_s)
    hash[temp.to_s] = temp
  else
    puts i
    exit
  end
  temp = f(temp)

end
