






"""simple docstring"""



import math




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->Optional[int]:







 if n <= 0:
  raise ValueError("""Only positive integers have prime factors"""			)
 UpperCAmelCase__ 						=				[]
 while n % 2 == 0:
  pf.append(2			)
  UpperCAmelCase__ 						=				int(n / 2			)
 for i in range(3       ,	int(math.sqrt(lowerCAmelCase_			)			) + 1       ,	2			):
  while n % i == 0:
   pf.append(lowerCAmelCase_			)
   UpperCAmelCase__ 						=				int(n / i			)
 if n > 2:
  pf.append(lowerCAmelCase_			)
 return pf




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->Optional[Any]:







 if n <= 0:
  raise ValueError("""Only positive numbers are accepted"""			)
 UpperCAmelCase__ 						=				1
 UpperCAmelCase__ 						=				1
 while n % 2 == 0:
  temp += 1
  UpperCAmelCase__ 						=				int(n / 2			)
 div *= temp
 for i in range(3       ,	int(math.sqrt(lowerCAmelCase_			)			) + 1       ,	2			):
  UpperCAmelCase__ 						=				1
  while n % i == 0:
   temp += 1
   UpperCAmelCase__ 						=				int(n / i			)
  div *= temp
 if n > 1:
  div *= 2
 return div




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->List[str]:







 if n <= 0:
  raise ValueError("""Only positive numbers are accepted"""			)
 UpperCAmelCase__ 						=				1
 UpperCAmelCase__ 						=				1
 while n % 2 == 0:
  temp += 1
  UpperCAmelCase__ 						=				int(n / 2			)
 if temp > 1:
  s *= (2**temp - 1) / (2 - 1)
 for i in range(3       ,	int(math.sqrt(lowerCAmelCase_			)			) + 1       ,	2			):
  UpperCAmelCase__ 						=				1
  while n % i == 0:
   temp += 1
   UpperCAmelCase__ 						=				int(n / i			)
  if temp > 1:
   s *= (i**temp - 1) / (i - 1)
 return int(lowerCAmelCase_			)




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->Union[str, Any]:
 UpperCAmelCase__ 						=				n
 for x in set(prime_factors(lowerCAmelCase_			)			):
  s *= (x - 1) / x
 return int(lowerCAmelCase_			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()






from __future__ import annotations

_lowerCamelCase							={1: 1}







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     if n in COLLATZ_SEQUENCE_LENGTHS:
          return COLLATZ_SEQUENCE_LENGTHS[n]
     SCREAMING_SNAKE_CASE 		=n // 2 if n % 2 == 0 else 3 * n + 1
     SCREAMING_SNAKE_CASE 		=collatz_sequence_length(lowerCAmelCase_     ) + 1
     SCREAMING_SNAKE_CASE 		=sequence_length
     return sequence_length







def      snake_case__							(  lowerCAmelCase_ = 1000000     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=max((collatz_sequence_length(lowerCAmelCase_     ), i) for i in range(1,       lowerCAmelCase_     )     )
     return result[1]


if __name__ == "__main__":
 print(solution(int(input().strip())))

