



import numpy as np
from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey

from digital_image_processing.filters.convolve import img_convolve





def 	__snake_case      (     _UpperCAmelCase							):
    __a					=							np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]							)
    __a					=							np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]							)

    __a					=							np.abs(img_convolve(_UpperCAmelCase  ,					_UpperCAmelCase							)							)
    __a					=							np.abs(img_convolve(_UpperCAmelCase  ,					_UpperCAmelCase							)							)
    # modify the pix within [0, 255]
    __a					=							dst_x * 255 / np.max(_UpperCAmelCase							)
    __a					=							dst_y * 255 / np.max(_UpperCAmelCase							)

    __a					=							np.sqrt((np.square(_UpperCAmelCase							)) + (np.square(_UpperCAmelCase							))							)
    __a					=							dst_xy * 255 / np.max(_UpperCAmelCase							)
    __a					=							dst_xy.astype(np.uinta							)

    __a					=							np.arctana(_UpperCAmelCase  ,					_UpperCAmelCase							)
    return dst, theta


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

 __snake_case						,__snake_case		:Union[str, Any] 						=	sobel_filter(gray)

 # show result images
 imshow('''sobel filter''', sobel_grad)
 imshow('''sobel theta''', sobel_theta)
 waitKey(0)










from __future__ import annotations

__snake_case		:Union[str, Any] 						=	{1: 1}





def 	__snake_case      (     _UpperCAmelCase							):
    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 	__snake_case      (     _UpperCAmelCase = 1000000							):
    __a					=							max((collatz_sequence_length(_UpperCAmelCase							), i) for i in range(1  ,					_UpperCAmelCase							)							)
    return result[1]


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





