


'''simple docstring'''
def    a__			(   lowerCAmelCase__ = 1_00_00_00		)       ->      int:
    UpperCAmelCase__     :						str						=							1
    UpperCAmelCase__     :						int						=							1
    UpperCAmelCase__     :						int						=							{1: 1}

    for inputa in range(2    ,   lowerCAmelCase__		):
        UpperCAmelCase__     :						List[Any]						=							0
        UpperCAmelCase__     :						Dict						=							inputa

        while True:
            if number in counters:
                counter += counters[number]
                break
            if number % 2 == 0:
                number //= 2
                counter += 1
            else:
                UpperCAmelCase__     :						Any						=							(3 * number) + 1
                counter += 1

        if inputa not in counters:
            UpperCAmelCase__     :						List[Any]						=							counter

        if counter > pre_counter:
            UpperCAmelCase__     :						List[Any]						=							inputa
            UpperCAmelCase__     :						Any						=							counter
    return largest_number


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







'''simple docstring'''






def   UpperCamelCase__ (						lowerCAmelCase    ):





      """simple docstring"""


      if not isinstance(lowerCAmelCase				,      lowerCAmelCase    ):
            raise ValueError("""Input must be an integer"""    )
      if input_num <= 0:
            raise ValueError("""Input must be positive"""    )
      return sum(
          divisor for divisor in range(1				,      input_num // 2 + 1    ) if input_num % divisor == 0    )


if __name__ == "__main__":
      import doctest

      doctest.testmod()






