INTEGER N(1000000)
READ*,N(1)
DO I=2,1000000
  IF(MOD(N(I-1),2)==0)THEN
    N(I)=N(I-1)/2
  ELSE
    N(I)=N(I-1)*3+1
  END IF
  DO J=1,I-1
    IF (N(I)==N(J))THEN
      PRINT"(I0)",I
      STOP
    ENDIF
  END DO
END DO
END