import strutils,sequtils import math proc input():string=stdin.readLine let n0=input().parseInt var n=n0 n_max=n cnt=0 if n==1: echo 0 echo 4 elif n==2: echo 1 echo 4 else: while n!=1: if n mod 2==0: n=n div 2 else: n=3*n+1 n_max=max(n,n_max) cnt.inc echo cnt echo n_max