


"""simple docstring"""







from collections.abc import Callable






class 						_A  :







    """simple docstring"""




    def __init__( self    :   Union[str, Any]    ,			__UpperCAmelCase    :   Callable | None = None):
      # Stores actual heap items.
      a						:		list											=      []
      # Stores indexes of each item for supporting updates and deletion.
      a						:		dict											=      {}
      # Stores current size of heap.
      a						:		Tuple											=      0
      # Stores function used to evaluate the score of an item on which basis ordering
      # will be done.
      a						:		Tuple											=      key or (lambda __UpperCAmelCase: x)






    def      __snake_case							( self    :   Union[str, Any]    ,			__UpperCAmelCase    :   int):
      return int((i - 1) / 2) if i > 0 else None






    def      __snake_case							( self    :   Optional[Any]    ,			__UpperCAmelCase    :   int):
      a						:		Union[str, Any]											=      int(2 * i + 1)
      return left if 0 < left < self.size else None






    def      __snake_case							( self    :   Optional[int]    ,			__UpperCAmelCase    :   int):
      a						:		Dict											=      int(2 * i + 2)
      return right if 0 < right < self.size else None






    def      __snake_case							( self    :   str    ,			__UpperCAmelCase    :   int    ,			__UpperCAmelCase    :   int):
      a							,		a						:		Optional[int]											=      (
          self.pos_map[self.arr[j][0]],
          self.pos_map[self.arr[i][0]],
      )
      # Then swap the items in the list.
      a							,		a						:		Any											=      self.arr[j], self.arr[i]






    def      __snake_case							( self    :   Dict    ,			__UpperCAmelCase    :   int    ,			__UpperCAmelCase    :   int):
      return self.arr[i][1] < self.arr[j][1]






    def      __snake_case							( self    :   List[str]    ,			__UpperCAmelCase    :   int):
      a						:		Dict											=      self._left(__UpperCAmelCase)
      a						:		Tuple											=      self._right(__UpperCAmelCase)
      a						:		int											=      i

      if left is not None and not self._cmp(__UpperCAmelCase    ,			__UpperCAmelCase):
        a						:		Optional[Any]											=      left
      if right is not None and not self._cmp(__UpperCAmelCase    ,			__UpperCAmelCase):
        a						:		List[Any]											=      right

      return valid_parent






    def      __snake_case							( self    :   Any    ,			__UpperCAmelCase    :   int):
      a						:		str											=      self._parent(__UpperCAmelCase)
      while parent is not None and not self._cmp(__UpperCAmelCase    ,			__UpperCAmelCase):
        self._swap(__UpperCAmelCase    ,			__UpperCAmelCase)
        a							,		a						:		Any											=      parent, self._parent(__UpperCAmelCase)






    def      __snake_case							( self    :   str    ,			__UpperCAmelCase    :   int):
      a						:		str											=      self._get_valid_parent(__UpperCAmelCase)
      while valid_parent != index:
        self._swap(__UpperCAmelCase    ,			__UpperCAmelCase)
        a							,		a						:		Optional[int]											=      valid_parent, self._get_valid_parent(__UpperCAmelCase)






    def      __snake_case							( self    :   Optional[Any]    ,			__UpperCAmelCase    :   int    ,			__UpperCAmelCase    :   int):
      if item not in self.pos_map:
        return
      a						:		Tuple											=      self.pos_map[item]
      a						:		List[str]											=      [item, self.key(__UpperCAmelCase)]
      # Make sure heap is right in both up and down direction.
      # Ideally only one of them will make any change.
      self._heapify_up(__UpperCAmelCase)
      self._heapify_down(__UpperCAmelCase)






    def      __snake_case							( self    :   str    ,			__UpperCAmelCase    :   int):
      if item not in self.pos_map:
        return
      a						:		Union[str, Any]											=      self.pos_map[item]
      del self.pos_map[item]
      a						:		List[str]											=      self.arr[self.size - 1]
      a						:		List[Any]											=      index
      self.size -= 1
      # Make sure heap is right in both up and down direction. Ideally only one
      # of them will make any change- so no performance loss in calling both.
      if self.size > index:
        self._heapify_up(__UpperCAmelCase)
        self._heapify_down(__UpperCAmelCase)






    def      __snake_case							( self    :   Optional[int]    ,			__UpperCAmelCase    :   int    ,			__UpperCAmelCase    :   int):
      a						:		Any											=      len(self.arr)
      if arr_len == self.size:
        self.arr.append([item, self.key(__UpperCAmelCase)])
      else:
        a						:		str											=      [item, self.key(__UpperCAmelCase)]
      a						:		List[str]											=      self.size
      self.size += 1
      self._heapify_up(self.size - 1)






    def      __snake_case							( self    :   Dict):
      return self.arr[0] if self.size else None






    def      __snake_case							( self    :   Union[str, Any]):
      a						:		Dict											=      self.get_top()
      if top_item_tuple:
        self.delete_item(top_item_tuple[0])
      return top_item_tuple






def 					lowercase      (    )->				None:
  '''simple docstring'''









if __name__ == "__main__":
 import doctest

 doctest.testmod()










"""simple docstring"""







from math import ceil, sqrt


def 					lowercase      (    A_ = 1_000_000	)->				int:
  '''simple docstring'''







  a						:		Tuple											=      0

  for outer_width in range(3  ,       (limit // 4) + 2	):
    if outer_width**2 > limit:
      a						:		str											=      max(ceil(sqrt(outer_width**2 - limit	)	)  ,       1	)
    else:
      a						:		Tuple											=      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() = }''')






