'''simple docstring'''




from __future__ import annotations

__snake_case   :      Tuple						    =  {1: 1}





def      _UpperCAmelCase    (							_UpperCamelCase    :	int   )	->      int:
    if n in COLLATZ_SEQUENCE_LENGTHS:
        return COLLATZ_SEQUENCE_LENGTHS[n]
    A_     =   n // 2 if n % 2 == 0 else 3 * n + 1
    A_     =   collatz_sequence_length(_UpperCamelCase   ) + 1
    A_     =   sequence_length
    return sequence_length





def      _UpperCAmelCase    (							_UpperCamelCase    :	int = 1_00_00_00   )	->      int:
    A_     =   max((collatz_sequence_length(_UpperCamelCase   ), i) for i in range(1,   _UpperCamelCase   )   )
    return result[1]


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







'''simple docstring'''




from scipy.constants import g





def      _UpperCAmelCase    (							_UpperCamelCase    :	float,   _UpperCamelCase    :	float   )	->      float:
    if mass < 0:
        # handling of negative values of mass
        raise ValueError('''The mass of a body cannot be negative'''   )
    if height < 0:
        # handling of negative values of height
        raise ValueError('''The height above the ground cannot be negative'''   )
    return mass * g * height


if __name__ == "__main__":
  from doctest import testmod

  testmod(name='potential_energy')






