program s implicit none integer(16)::X integer(16)::m integer::CNT=0 read*,X m=X do while(X/=1) X=merge(X/2,3*X+1,mod(X,2_16)==0) CNT=CNT+1 m=max(m,x) end do print"(I0,A,i0)",cnt," ",M end program s