s = gets.to_i
count = 0

if [4, 2, 1].include?(s)
  puts 3 - [4, 2, 1].index(s)
else
  while s != 4
    if s % 2 == 1
      s = s * 3 + 1
    else
      s = s / 2
    end
    count += 1
  end
  puts count + 4
end
