






from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like


def __A       ( __lowerCAmelCase					,						__lowerCAmelCase=3      )->    List[str]:





						"""simple docstring"""



						_UpperCAmelCase							   =     int(mask / 2      )
						# copy image size
						_UpperCAmelCase							   =     zeros_like(_UpperCAmelCase      )
						for i in range(_UpperCAmelCase					,						gray_img.shape[0] - bd      ):
												for j in range(_UpperCAmelCase					,						gray_img.shape[1] - bd      ):
																		# get mask according with mask
																		_UpperCAmelCase							   =     ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]      )
																		# calculate mask median
																		_UpperCAmelCase							   =     sort(_UpperCAmelCase      )[inta(divide((multiply(_UpperCAmelCase					,						_UpperCAmelCase      ))					,						2      ) + 1      )]
																		_UpperCAmelCase							   =     median
						return median_img


if __name__ == "__main__":
		# read original image
		_a       =    imread('''../image_data/lena.jpg''')
		# turn image in gray scale value
		_a       =    cvtColor(img, COLOR_BGR2GRAY)

		# get values with two different mask size
		_a       =    median_filter(gray, 3)
		_a       =    median_filter(gray, 5)

		# show result images
		imshow('''median filter with 3x3 mask''', medianaxa)
		imshow('''median filter with 5x5 mask''', medianaxa)
		waitKey(0)







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




