






"""simple docstring"""





from collections.abc import Sequence
from queue import Queue



class       __A		:

					def __init__(			self  :      Any     ,		__snake_case  :      Dict     ,		__snake_case  :      List[str]     ,		__snake_case  :      Dict     ,		__snake_case  :      Optional[int]=None     ,		__snake_case  :      Optional[Any]=None					)			->							Tuple:
											__magic_name__:	List[str]							=       start
											__magic_name__:	Tuple							=       end
											__magic_name__:	List[str]							=       val
											__magic_name__:	str							=       (start + end) // 2
											__magic_name__:	Any							=       left
											__magic_name__:	Tuple							=       right






					def __repr__(			self  :      List[Any]					)			->							List[str]:
											return F'SegmentTreeNode(start={self.start}, end={self.end}, val={self.val})'



class       __A		:

					def __init__(			self  :      Any     ,		__snake_case  :      Sequence     ,		__snake_case  :      List[str]					)			->							Tuple:
											__magic_name__:	List[Any]							=       collection
											__magic_name__:	Tuple							=       function
											if self.collection:
																	__magic_name__:	int							=       self._build_tree(0     ,		len(__snake_case					) - 1					)

					def   lowerCamelCase__   (			self  :      Tuple     ,		__snake_case  :      Tuple     ,		__snake_case  :      Tuple					)			->							Union[str, Any]:
											self._update_tree(self.root     ,		__snake_case     ,		__snake_case					)

					def   lowerCamelCase__   (			self  :      Optional[Any]     ,		__snake_case  :      Any     ,		__snake_case  :      int					)			->							Optional[Any]:
											return self._query_range(self.root     ,		__snake_case     ,		__snake_case					)

					def   lowerCamelCase__   (			self  :      Dict     ,		__snake_case  :      List[Any]     ,		__snake_case  :      Dict					)			->							Tuple:
											if start == end:
																	return SegmentTreeNode(__snake_case     ,		__snake_case     ,		self.collection[start]					)
											__magic_name__:	str							=       (start + end) // 2
											__magic_name__:	List[str]							=       self._build_tree(__snake_case     ,		__snake_case					)
											__magic_name__:	Any							=       self._build_tree(mid + 1     ,		__snake_case					)
											return SegmentTreeNode(__snake_case     ,		__snake_case     ,		self.fn(left.val     ,		right.val					)     ,		__snake_case     ,		__snake_case					)

					def   lowerCamelCase__   (			self  :      List[Any]     ,		__snake_case  :      Any     ,		__snake_case  :      str     ,		__snake_case  :      Any					)			->							Optional[int]:
											if node.start == i and node.end == i:
																	__magic_name__:	Optional[Any]							=       val
																	return
											if i <= node.mid:
																	self._update_tree(node.left     ,		__snake_case     ,		__snake_case					)
											else:
																	self._update_tree(node.right     ,		__snake_case     ,		__snake_case					)
											__magic_name__:	str							=       self.fn(node.left.val     ,		node.right.val					)

					def   lowerCamelCase__   (			self  :      str     ,		__snake_case  :      List[str]     ,		__snake_case  :      Tuple     ,		__snake_case  :      Tuple					)			->							Any:
											if node.start == i and node.end == j:
																	return node.val

											if i <= node.mid:
																	if j <= node.mid:
																							# range in left child tree
																							return self._query_range(node.left     ,		__snake_case     ,		__snake_case					)
																	else:
																							# range in left child tree and right child tree
																							return self.fn(
																							    self._query_range(node.left     ,		__snake_case     ,		node.mid					)     ,		self._query_range(node.right     ,		node.mid + 1     ,		__snake_case					)     ,		)
											else:
																	# range in right child tree
																	return self._query_range(node.right     ,		__snake_case     ,		__snake_case					)






					def   lowerCamelCase__   (			self  :      Optional[Any]					)			->							str:
											if self.root is not None:
																	__magic_name__:	Union[str, Any]							=       Queue()
																	queue.put(self.root					)
																	while not queue.empty():
																							__magic_name__:	Any							=       queue.get()
																							yield node

																							if node.left is not None:
																													queue.put(node.left					)

																							if node.right is not None:
																													queue.put(node.right					)


if __name__ == "__main__":
							import operator

							for fn in [operator.add, max, min]:
														print('*' * 50)
														__lowerCamelCase							=  SegmentTree([2, 1, 5, 3, 4], fn)
														for node in arr.traverse():
																					print(node)
														print()

														arr.update(1, 5)
														for node in arr.traverse():
																					print(node)
														print()

														print(arr.query_range(3, 4))  # 7
														print(arr.query_range(2, 2))  # 5
														print(arr.query_range(1, 3))  # 13
														print()





"""simple docstring"""

from math import ceil, sqrt




def      lowercase__    (       lowerCAmelCase					:       int = 1_000_000			)			->   int:






    """simple docstring"""




    UpperCAmelCase          =       0

    for outer_width in range(3			,					(limit // 4) + 2			):
        if outer_width**2 > limit:
            UpperCAmelCase          =       max(ceil(sqrt(outer_width**2 - limit			)			)			,					1			)
        else:
            UpperCAmelCase          =       1
        if (outer_width - hole_width_lower_bound) % 2:
            hole_width_lower_bound += 1

        answer += (outer_width - hole_width_lower_bound - 2) // 2 + 1

    return answer


if __name__ == "__main__":
   print(F'{solution() = }')



