N0 = gets.to_i n = N0 nums = [] while n > 1 nums << n if n.even? n /= 2 else n = 3 * n + 1 end end puts nums.size puts nums.max