X = Enumerator.produce(gets.to_i) {|x| x == 1 ? (raise StopIteration) : x.odd? ? x * 3 + 1 : x / 2 } puts [X.max, X.count-1]