



from pathlib import Path

import numpy as np
from PIL import Image






def      lowerCAmelCase__		(   lowerCamelCase_		:		np.ndarray):





				'''simple docstring'''

				lowerCAmelCase__						,		lowerCAmelCase__						,		lowerCAmelCase__					:    Any												=					rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
				return 0.2989 * r + 0.5870 * g + 0.1140 * b






def      lowerCAmelCase__		(   lowerCamelCase_		:		np.ndarray):





				'''simple docstring'''

				return (gray > 127) & (gray <= 255)






def      lowerCAmelCase__		(   lowerCamelCase_		:		np.ndarray	,lowerCamelCase_		:		np.ndarray):





				'''simple docstring'''

				lowerCAmelCase__					:    Union[str, Any]												=					np.zeros_like(lowerCamelCase_)
				lowerCAmelCase__					:    Optional[Any]												=					np.zeros(
				    (image.shape[0] + kernel.shape[0] - 1, image.shape[1] + kernel.shape[1] - 1))

				# Copy image to padded image
				lowerCAmelCase__					:    Optional[Any]												=					image

				# Iterate over image & apply kernel
				for x in range(image.shape[1]):
								for y in range(image.shape[0]):
												lowerCAmelCase__					:    List[str]												=					(
												    kernel * image_padded[y : y + kernel.shape[0], x : x + kernel.shape[1]]
												).sum()
												lowerCAmelCase__					:    Optional[int]												=					int(summation > 0)
				return output


if __name__ == "__main__":
							# read original image
							__snake_case    :		List[Any]  =Path(__file__).resolve().parent / 'image_data' / 'lena.jpg'
							__snake_case    :		Optional[Any]  =np.array(Image.open(lena_path))
							# kernel to be applied
							__snake_case    :		Union[str, Any]  =np.array([[0, 1, 0], [1, 1, 1], [0, 1, 0]])
							__snake_case    :		Optional[Any]  =dilation(gray_to_binary(rgb_to_gray(lena)), structuring_element)
							# Save the output image
							__snake_case    :		Optional[int]  =Image.fromarray(output).convert('RGB')
							pil_img.save('result_dilation.png')






def      lowerCAmelCase__		(   lowerCamelCase_		:		int = 1000):





				'''simple docstring'''

				lowerCAmelCase__						,		lowerCAmelCase__					:    int												=					1, 1
				lowerCAmelCase__					:    Any												=					2
				while True:
								lowerCAmelCase__					:    Optional[Any]												=					0
								lowerCAmelCase__					:    Any												=					fa + fa
								lowerCAmelCase__						,		lowerCAmelCase__					:    Optional[Any]												=					fa, f
								index += 1
								for _ in str(lowerCamelCase_):
												i += 1
								if i == n:
												break
				return index


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

