
from typing import List

import PIL
import torch
from PIL import Image

from ...configuration_utils import ConfigMixin
from ...models.modeling_utils import ModelMixin
from ...utils import PIL_INTERPOLATION

class        UpperCamelCase__(    snake_case__						,						snake_case__	):

	"""simple docstring"""

	def __init__(      self				:			Any ):
			"""simple docstring"""





			super().__init__()

			self.register_buffer("watermark_image"							,			torch.zeros((62, 62, 4) ) )
			A				=None







	def        _a					(      self				:			List[Any]							,			snake_case__				:			List[PIL.Image.Image]							,			snake_case__				:			int=None ):
			"""simple docstring"""





			A				=images[0].height
			A				=images[0].width

			A				=sample_size or h

			A				=min(h / sample_size							,			w / sample_size )
			A				=(int(h / coef ), int(w / coef )) if coef < 1 else (h, w)

			A				=10_24**2, img_w * img_h
			A				=(Sa / Sa) ** 0.5
			A				=int(K * 62 ), img_w - int(14 * K ), img_h - int(14 * K )

			if self.watermark_image_as_pil is None:
					A				=self.watermark_image.to(torch.uinta ).cpu().numpy()
					A				=Image.fromarray(UpperCAmelCase_							,			mode="RGBA" )
					A				=watermark_image

			A				=self.watermark_image_as_pil.resize(
			    (wm_size, wm_size)							,			PIL_INTERPOLATION["bicubic"]							,			reducing_gap=UpperCAmelCase_ )

			for pil_img in images:
					pil_img.paste(UpperCAmelCase_							,			box=(wm_x - wm_size, wm_y - wm_size, wm_x, wm_y)							,			mask=wm_img.split()[-1] )

			return images











'''simple docstring'''

from __future__ import annotations

lowerCAmelCase__      :   Tuple      	=			{1: 1}


def 						__UpperCamelCase						(			_UpperCAmelCase  ):
		if n in COLLATZ_SEQUENCE_LENGTHS:
				return COLLATZ_SEQUENCE_LENGTHS[n]
		__UpperCAmelCase	:							int     =     n // 2 if n % 2 == 0 else 3 * n + 1
		__UpperCAmelCase	:							str     =     collatz_sequence_length(_UpperCAmelCase  ) + 1
		__UpperCAmelCase	:							Union[str, Any]     =     sequence_length
		return sequence_length


def 						__UpperCamelCase						(			_UpperCAmelCase = 1000000  ):
		__UpperCAmelCase	:							Union[str, Any]     =     max((collatz_sequence_length(_UpperCAmelCase  ), i) for i in range(1,       _UpperCAmelCase  )  )
		return result[1]


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




