
"""simple docstring"""




def 							a__ (				lowerCAmelCase	:       bytes		):






					'''simple docstring'''
					return "".join([hex(A__		)[2:].zfill(2		).upper() for byte in list(A__		)]		)



def 							a__ (				lowerCAmelCase	:       str		):






					'''simple docstring'''



					if (len(A__		) % 2) != 0:
										raise ValueError(
										    "Base16 encoded data is invalid:\nData does not have an even number of hex digits."		)
					# Check the character set - the standard base16 alphabet
					# is uppercase according to RFC3548 section 6
					if not set(A__		) <= set("0123456789ABCDEF"		):
										raise ValueError(
										    "Base16 encoded data is invalid:\nData is not uppercase hex or it contains invalid characters."		)
					# For every two hexadecimal digits (= a byte), turn it into an integer.
					# Then, string the result together into bytes, and return it.
					return bytes(int(data[i] + data[i + 1]       ,    16		) for i in range(0       ,    len(A__		)       ,    2		)		)


if __name__ == "__main__":
				import doctest

				doctest.testmod()





"""simple docstring"""




from math import isqrt



def 							a__ (				lowerCAmelCase	:       int		):






     '''simple docstring'''
     UpperCAmelCase__							: Tuple 							=						[True] * max_number
     for i in range(2       ,    isqrt(max_number - 1		) + 1		):
          if is_prime[i]:
               for j in range(i**2       ,    lowerCAmelCase       ,    lowerCAmelCase		):
                    UpperCAmelCase__							: List[Any] 							=						False

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



def 							a__ (				lowerCAmelCase	:       int = 10**8		):






     '''simple docstring'''
     UpperCAmelCase__							: Dict 							=						calculate_prime_numbers(max_number // 2		)

     UpperCAmelCase__							: Optional[int] 							=						0
     UpperCAmelCase__							: Optional[int] 							=						0
     UpperCAmelCase__							: Tuple 							=						len(lowerCAmelCase		) - 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() = }""")



