




"""simple docstring"""




from __future__ import annotations



def     a__ (				snake_case__       , snake_case__				)						->					int:
			lowerCamelCase			      =					position
			lowerCamelCase			      =					[
			    (y + 1, x + 2),
			    (y - 1, x + 2),
			    (y + 1, x - 2),
			    (y - 1, x - 2),
			    (y + 2, x + 1),
			    (y + 2, x - 1),
			    (y - 2, x + 1),
			    (y - 2, x - 1),
			]
			lowerCamelCase			      =					[]

			for position in positions:
						lowerCamelCase			      =					position
						if 0 <= y_test < n and 0 <= x_test < n:
									permissible_positions.append(__snake_case				)

			return permissible_positions



def     a__ (				snake_case__				)						->					Optional[int]:
			return not any(elem == 0 for row in board for elem in row				)



def     a__ (				snake_case__       , snake_case__       , snake_case__				)						->					List[str]:

			if is_complete(__snake_case				):
						return True

			for position in get_valid_pos(__snake_case       , len(__snake_case				)				):
						lowerCamelCase			      =					position

						if board[y][x] == 0:
									lowerCamelCase			      =					curr + 1
									if open_knight_tour_helper(__snake_case       , __snake_case       , curr + 1				):
												return True
									lowerCamelCase			      =					0

			return False



def     a__ (				snake_case__				)						->					str:
			lowerCamelCase			      =					[[0 for i in range(__snake_case				)] for j in range(__snake_case				)]

			for i in range(__snake_case				):
						for j in range(__snake_case				):
									lowerCamelCase			      =					1
									if open_knight_tour_helper(__snake_case       , (i, j)       , 1				):
												return board
									lowerCamelCase			      =					0

			lowerCamelCase			      =					F'Open Kight Tour cannot be performed on a board of size {n}'
			raise ValueError(__snake_case				)


if __name__ == "__main__":
					import doctest

					doctest.testmod()











"""simple docstring"""



def 						lowercase    (				__snake_case				: int = 1_0_0_0	):
		lowercase_       ,					lowercase_ : str							       =   1, 1
		lowercase_ : List[str]							       =   2
		while True:
				lowercase_ : Tuple							       =   0
				lowercase_ : List[Any]							       =   fa + fa
				lowercase_       ,					lowercase_ : Optional[int]							       =   fa, f
				index += 1
				for _ in str(__snake_case	):
						i += 1
				if i == n:
						break
		return index


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



