






'''simple docstring'''

def    lowercase__			(				__UpperCamelCase = 1000000   )->			int:
      UpperCamelCase      = 1
      UpperCamelCase      = 1
      UpperCamelCase      = {1: 1}

      for inputa in range(2		,						__UpperCamelCase   ):
            UpperCamelCase      = 0
            UpperCamelCase      = inputa

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

            if inputa not in counters:
                  UpperCamelCase      = counter

            if counter > pre_counter:
                  UpperCamelCase      = inputa
                  UpperCamelCase      = counter
      return largest_number


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








'''simple docstring'''

from PIL import Image







def    lowercase__			(				__UpperCamelCase		,						__UpperCamelCase   )->			Image:

      def brightness(__UpperCamelCase   ) -> float:
            return 128 + level + (c - 128)

      if not -255.0 <= level <= 255.0:
            raise ValueError("""level must be between -255.0 (black) and 255.0 (white)"""   )
      return img.point(__UpperCamelCase   )


if __name__ == "__main__":
     # Load image
     with Image.open('image_data/lena.jpg') as img:
          # Change brightness to 100
          SCREAMING_SNAKE_CASE__     =       change_brightness(img, 1_0_0)
          brigt_img.save('image_data/lena_brightness.png', format='png')
