a=2*io.read()while(a>1)do a=({a/2,3*a+1})[a%2+1]print(a)end