

def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_ = 1000     ):





     """simple docstring"""







     if (not isinstance(lowerCAmelCase_,       lowerCAmelCase_     )) or (digit_position <= 0):
          raise ValueError('Digit position must be a positive integer'     )
     elif (not isinstance(lowerCAmelCase_,       lowerCAmelCase_     )) or (precision < 0):
          raise ValueError('Precision must be a nonnegative integer'     )

     # compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
     # accurate
     SCREAMING_SNAKE_CASE 		=(
         4 * _subsum(lowerCAmelCase_,       1,       lowerCAmelCase_     )
         - 2 * _subsum(lowerCAmelCase_,       4,       lowerCAmelCase_     )
         - _subsum(lowerCAmelCase_,       5,       lowerCAmelCase_     )
         - _subsum(lowerCAmelCase_,       6,       lowerCAmelCase_     )
     )

     # return the first hex digit of the fractional part of the result
     return hex(int((sum_result % 1) * 16     )     )[2:]







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_,       lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=0.0
     for sum_index in range(digit_pos_to_extract + precision     ):
          SCREAMING_SNAKE_CASE 		=8 * sum_index + denominator_addend
          if sum_index < digit_pos_to_extract:
               # if the exponential term is an integer and we mod it by the denominator
               # before dividing, only the integer part of the sum will change;
               # the fractional part will not
               SCREAMING_SNAKE_CASE 		=pow(
                   16,       digit_pos_to_extract - 1 - sum_index,       lowerCAmelCase_     )
          else:
               SCREAMING_SNAKE_CASE 		=pow(16,       digit_pos_to_extract - 1 - sum_index     )
          total += exponential_term / denominator
     return total


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())))

