"""simple docstring"""


from __future__ import annotations

from collections.abc import Iterator
from typing import Any


class 							a					:


    def __init__(       self						:	Tuple ,					__lowerCAmelCase						:	Any       ):
      _UpperCAmelCase    			=   data
      _UpperCAmelCase    			=   None



class 							a					:


    def __init__(       self						:	int       ):
      _UpperCAmelCase    			=   None
      _UpperCAmelCase    			=   None


    def __iter__(       self						:	Union[str, Any]       ):
      _UpperCAmelCase    			=   self.head
      while self.head:
        yield node.data
        _UpperCAmelCase    			=   node.next
        if node == self.head:
          break


    def __len__(       self						:	Dict       ):
      return sum(1 for _ in self       )


    def __repr__(       self						:	Tuple       ):
      return "->".join(str(__lowerCAmelCase       ) for item in iter(self       )       )


    def   lowerCAmelCase_	(       self						:	str ,					__lowerCAmelCase						:	Any       ):
      self.insert_nth(len(self       ) ,					__lowerCAmelCase       )


    def   lowerCAmelCase_	(       self						:	str ,					__lowerCAmelCase						:	Any       ):
      self.insert_nth(0 ,					__lowerCAmelCase       )


    def   lowerCAmelCase_	(       self						:	Any ,					__lowerCAmelCase						:	int ,					__lowerCAmelCase						:	Any       ):
      if index < 0 or index > len(self       ):
        raise IndexError("""list index out of range."""       )
      _UpperCAmelCase    			=   Node(__lowerCAmelCase       )
      if self.head is None:
        _UpperCAmelCase    			=   new_node  # first node points itself
        _UpperCAmelCase    			=   _UpperCAmelCase    			=   new_node
      elif index == 0:  # insert at head
        _UpperCAmelCase    			=   self.head
        _UpperCAmelCase    			=   _UpperCAmelCase    			=   new_node
      else:
        _UpperCAmelCase    			=   self.head
        for _ in range(index - 1       ):
          _UpperCAmelCase    			=   temp.next
        _UpperCAmelCase    			=   temp.next
        _UpperCAmelCase    			=   new_node
        if index == len(self       ) - 1:  # insert at tail
          _UpperCAmelCase    			=   new_node


    def   lowerCAmelCase_	(       self						:	Optional[int]       ):
      return self.delete_nth(0       )


    def   lowerCAmelCase_	(       self						:	Tuple       ):
      return self.delete_nth(len(self       ) - 1       )


    def   lowerCAmelCase_	(       self						:	int ,					__lowerCAmelCase						:	int = 0       ):
      if not 0 <= index < len(self       ):
        raise IndexError("""list index out of range."""       )
      _UpperCAmelCase    			=   self.head
      if self.head == self.tail:  # just one node
        _UpperCAmelCase    			=   _UpperCAmelCase    			=   None
      elif index == 0:  # delete head node
        _UpperCAmelCase    			=   self.tail.next.next
        _UpperCAmelCase    			=   self.head.next
      else:
        _UpperCAmelCase    			=   self.head
        for _ in range(index - 1       ):
          _UpperCAmelCase    			=   temp.next
        _UpperCAmelCase    			=   temp.next
        _UpperCAmelCase    			=   temp.next.next
        if index == len(self       ) - 1:  # delete at tail
          _UpperCAmelCase    			=   temp
      return delete_node.data


    def   lowerCAmelCase_	(       self						:	Any       ):
      return len(self       ) == 0






def      __UpperCAmelCase       (      ):







  """simple docstring"""
  _UpperCAmelCase    			=   CircularLinkedList()
  assert len(lowercase		) == 0
  assert circular_linked_list.is_empty() is True
  assert str(lowercase		) == ""

  try:
    circular_linked_list.delete_front()
    raise AssertionError  # This should not happen
  except IndexError:
    assert True  # This should happen

  try:
    circular_linked_list.delete_tail()
    raise AssertionError  # This should not happen
  except IndexError:
    assert True  # This should happen

  try:
    circular_linked_list.delete_nth(-1		)
    raise AssertionError
  except IndexError:
    assert True

  try:
    circular_linked_list.delete_nth(0		)
    raise AssertionError
  except IndexError:
    assert True

  assert circular_linked_list.is_empty() is True
  for i in range(5		):
    assert len(lowercase		) == i
    circular_linked_list.insert_nth(lowercase ,i + 1		)
  assert str(lowercase		) == "->".join(str(lowercase		) for i in range(1 ,6		)		)

  circular_linked_list.insert_tail(6		)
  assert str(lowercase		) == "->".join(str(lowercase		) for i in range(1 ,7		)		)
  circular_linked_list.insert_head(0		)
  assert str(lowercase		) == "->".join(str(lowercase		) for i in range(0 ,7		)		)

  assert circular_linked_list.delete_front() == 0
  assert circular_linked_list.delete_tail() == 6
  assert str(lowercase		) == "->".join(str(lowercase		) for i in range(1 ,6		)		)
  assert circular_linked_list.delete_nth(2		) == 3

  circular_linked_list.insert_nth(2 ,3		)
  assert str(lowercase		) == "->".join(str(lowercase		) for i in range(1 ,6		)		)

  assert circular_linked_list.is_empty() is False


if __name__ == "__main__":
    import doctest

    doctest.testmod()

"""simple docstring"""


from math import isqrt






def      __UpperCAmelCase       (      lowercase		):







  """simple docstring"""
  _UpperCAmelCase    			=   [True] * max_number
  for i in range(2 ,isqrt(max_number - 1		) + 1		):
    if is_prime[i]:
      for j in range(i**2 ,lowercase ,lowercase		):
        _UpperCAmelCase    			=   False

  return [i for i in range(2 ,lowercase		) if is_prime[i]]






def      __UpperCAmelCase       (      lowercase = 10**8		):







  """simple docstring"""
  _UpperCAmelCase    			=   calculate_prime_numbers(max_number // 2		)

  _UpperCAmelCase    			=   0
  _UpperCAmelCase    			=   0
  _UpperCAmelCase    			=   len(lowercase		) - 1
  while left <= right:
    while prime_numbers[left] * prime_numbers[right] >= max_number:
      right -= 1
    semiprimes_count += right - left + 1
    left += 1

  return semiprimes_count


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