


import math




def  a   (lowerCAmelCase__   ):
   __a					=  [True] * n
   __a					=  False
   __a					=  False
   __a					=  True

   for i in range(3		,				int(n**0.5 + 1   )		,				2   ):
      __a					=  i * 2
      while index < n:
         __a					=  False
         __a					=  index + i

   __a					=  [2]

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

   return primes




def  a   (lowerCAmelCase__ = 999_966_663_333   ):
   __a					=  math.floor(math.sqrt(__lowercase   )   ) + 100
   __a					=  prime_sieve(__lowercase   )

   __a					=  0
   __a					=  0
   __a					=  primes[prime_index]

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

      __a					=  last_prime**2
      __a					=  next_prime**2

      # Get numbers divisible by lps(current)
      __a					=  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)
      __a					=  upper_bound - next_prime
      while current > lower_bound:
         matches_sum += current
         current -= next_prime

      # Remove the numbers divisible by both ups and lps
      __a					=  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
      __a					=  next_prime
      prime_index += 1

   return matches_sum


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









'''simple docstring'''







from __future__ import annotations







class 					_a :





     '''simple docstring'''



     def __init__(				self							,__a = 0							)      ->				str:
          snake_case			:      List[Any]        =			key







     def 			snake_case_      (				self							,__a							,__a							)      ->				list[str]:
          assert isinstance(__a							,__a							) and isinstance(__a							,__a							)

          snake_case			:      Tuple        =			key or self.__key or 1

          # make sure key is an appropriate size
          key %= 255

          return [chr(ord(__a							) ^ key							) for ch in content]







     def 			snake_case_      (				self							,__a							,__a							)      ->				list[str]:
          assert isinstance(__a							,__a							) and isinstance(__a							,__a							)

          snake_case			:      List[Any]        =			key or self.__key or 1

          # make sure key is an appropriate size
          key %= 255

          return [chr(ord(__a							) ^ key							) for ch in content]







     def 			snake_case_      (				self							,__a							,__a = 0							)      ->				str:
          assert isinstance(__a							,__a							) and isinstance(__a							,__a							)

          snake_case			:      List[Any]        =			key or self.__key or 1

          # make sure key can be any size
          while key > 255:
               key -= 255

          # This will be returned
          snake_case			:      List[str]        =			""""""

          for ch in content:
               ans += chr(ord(__a							) ^ key							)

          return ans







     def 			snake_case_      (				self							,__a							,__a = 0							)      ->				str:
          assert isinstance(__a							,__a							) and isinstance(__a							,__a							)

          snake_case			:      Any        =			key or self.__key or 1

          # make sure key can be any size
          while key > 255:
               key -= 255

          # This will be returned
          snake_case			:      List[str]        =			""""""

          for ch in content:
               ans += chr(ord(__a							) ^ key							)

          return ans







     def 			snake_case_      (				self							,__a							,__a = 0							)      ->				bool:
          assert isinstance(__a							,__a							) and isinstance(__a							,__a							)

          try:
               with open(__a							) as fin, open("""encrypt.out"""							,"""w+"""							) as fout:
                    # actual encrypt-process
                    for line in fin:
                         fout.write(self.encrypt_string(__a							,__a							)							)

          except OSError:
               return False

          return True







     def 			snake_case_      (				self							,__a							,__a							)      ->				bool:
          assert isinstance(__a							,__a							) and isinstance(__a							,__a							)

          try:
               with open(__a							) as fin, open("""decrypt.out"""							,"""w+"""							) as fout:
                    # actual encrypt-process
                    for line in fin:
                         fout.write(self.decrypt_string(__a							,__a							)							)

          except OSError:
               return False

          return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")



