





import math



def 	A_       (  _lowerCAmelCase  )		->				list:
 UpperCamelCase			:      str			=     [True] * n
 UpperCamelCase			:      int			=     False
 UpperCamelCase			:      Any			=     False
 UpperCamelCase			:      Any			=     True

 for i in range(3							,     int(n**0.5 + 1  )							,     2  ):
  UpperCamelCase			:      Union[str, Any]			=     i * 2
  while index < n:
   UpperCamelCase			:      Dict			=     False
   UpperCamelCase			:      Dict			=     index + i

 UpperCamelCase			:      Tuple			=     [2]

 for i in range(3							,     _lowerCAmelCase							,     2  ):
  if is_prime[i]:
   primes.append(_lowerCAmelCase  )

 return primes



def 	A_       (  _lowerCAmelCase = 9999_6666_3333  )		->				int:
 UpperCamelCase			:      Dict			=     math.floor(math.sqrt(_lowerCAmelCase  )  ) + 100
 UpperCamelCase			:      Union[str, Any]			=     prime_sieve(_lowerCAmelCase  )

 UpperCamelCase			:      Tuple			=     0
 UpperCamelCase			:      Dict			=     0
 UpperCamelCase			:      str			=     primes[prime_index]

 while (last_prime**2) <= limit:
  UpperCamelCase			:      Dict			=     primes[prime_index + 1]

  UpperCamelCase			:      Optional[Any]			=     last_prime**2
  UpperCamelCase			:      Any			=     next_prime**2

  # Get numbers divisible by lps(current)
  UpperCamelCase			:      List[str]			=     lower_bound + last_prime
  while upper_bound > current <= limit:
   matches_sum += current
   current += last_prime

  # Reset the upper_bound
  while (upper_bound - next_prime) > limit:
   upper_bound -= next_prime

  # Add the numbers divisible by ups(current)
  UpperCamelCase			:      List[Any]			=     upper_bound - next_prime
  while current > lower_bound:
   matches_sum += current
   current -= next_prime

  # Remove the numbers divisible by both ups and lps
  UpperCamelCase			:      Optional[Any]			=     0
  while upper_bound > current <= limit:
   if current <= lower_bound:
    # Increment the current number
    current += last_prime * next_prime
    continue

   if current > limit:
    break

   # Remove twice since it was added by both ups and lps
   matches_sum -= current * 2

   # Increment the current number
   current += last_prime * next_prime

  # Setup for next pair
  UpperCamelCase			:      Tuple			=     next_prime
  prime_index += 1

 return matches_sum


if __name__ == "__main__":
    print(solution())







from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream



class       A__     ( __snake_case    ):





      def __init__(				self ,							A_ ,							A_ = None ,							A_ = None ,							A_ = False ,							A_ = False ,							A_ = None ,							A_ = None ,							**A_ ,							):
       '''simple docstring'''




       super().__init__(
           features=A_ ,							cache_dir=A_ ,							keep_in_memory=A_ ,							streaming=A_ ,							num_proc=A_ ,							**A_ ,							)
       UpperCamelCase			:      Optional[int] 			=     Generator(
           cache_dir=A_ ,							features=A_ ,							generator=A_ ,							gen_kwargs=A_ ,							**A_ ,							)





      def  __UpperCamelCase(				self     ):
       '''simple docstring'''




       if self.streaming:
        UpperCamelCase			:      Optional[Any] 			=     self.builder.as_streaming_dataset(split="train"     )
       # Build regular (map-style) dataset
       else:
        UpperCamelCase			:      Union[str, Any] 			=     None
        UpperCamelCase			:      Union[str, Any] 			=     None
        UpperCamelCase			:      List[Any] 			=     None
        UpperCamelCase			:      List[str] 			=     None

        self.builder.download_and_prepare(
            download_config=A_ ,							download_mode=A_ ,							verification_mode=A_ ,							base_path=A_ ,							num_proc=self.num_proc ,							)
        UpperCamelCase			:      int 			=     self.builder.as_dataset(
            split="train" ,							verification_mode=A_ ,							in_memory=self.keep_in_memory     )
       return dataset
