





import argparse
import hashlib  # hashlib is only used inside the Test class
import struct

class        __SCREAMING_SNAKE_CASE					:






							def __init__(						self  , __lowerCAmelCase  ):
														UpperCamelCase__				     =			data
														UpperCamelCase__				     =			[0x67_452_301, 0xef_cda_b89, 0x98_bad_cfe, 0x10_325_476, 0xc3_d2e_1f0]






							@staticmethod
							def 				_lowerCamelCase		(						__lowerCAmelCase  , __lowerCAmelCase  ):
														return ((n << b) | (n >> (32 - b))) & 0xff_fff_fff






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			B"""\x80""" + B"""\x00""" * (63 - (len(self.data  ) + 8) % 64)
														UpperCamelCase__				     =			self.data + padding + struct.pack(""">Q"""  , 8 * len(self.data  )  )
														return padded_data






							def 				_lowerCamelCase		(						self  ):
														return [
														    self.padded_data[i : i + 64] for i in range(0  , len(self.padded_data  )  , 64  )
														]






							def 				_lowerCamelCase		(						self  , __lowerCAmelCase  ):
														UpperCamelCase__				     =			list(struct.unpack(""">16L"""  , lowercase__  )  ) + [0] * 64
														for i in range(16  , 80  ):
																					UpperCamelCase__				     =			self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16])  , 1  )
														return w







							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			self.padding()
														UpperCamelCase__				     =			self.split_blocks()
														for block in self.blocks:
																					UpperCamelCase__				     =			self.expand_block(lowercase__  )
																					UpperCamelCase__				     =			self.h
																					for i in range(0  , 80  ):
																												if 0 <= i < 20:
																																			UpperCamelCase__				     =			(b & c) | ((~b) & d)
																																			UpperCamelCase__				     =			0x5a_827_999
																												elif 20 <= i < 40:
																																			UpperCamelCase__				     =			b ^ c ^ d
																																			UpperCamelCase__				     =			0x6e_d9e_ba1
																												elif 40 <= i < 60:
																																			UpperCamelCase__				     =			(b & c) | (b & d) | (c & d)
																																			UpperCamelCase__				     =			0x8f_1bb_cdc
																												elif 60 <= i < 80:
																																			UpperCamelCase__				     =			b ^ c ^ d
																																			UpperCamelCase__				     =			0xca_62c_1d6
																												UpperCamelCase__				     =			(
																												    self.rotate(lowercase__  , 5  ) + f + e + k + expanded_block[i] & 0xff_fff_fff,
																												    a,
																												    self.rotate(lowercase__  , 30  ),
																												    c,
																												    d,
																												)
																					UpperCamelCase__				     =			(
																					    self.h[0] + a & 0xff_fff_fff,
																					    self.h[1] + b & 0xff_fff_fff,
																					    self.h[2] + c & 0xff_fff_fff,
																					    self.h[3] + d & 0xff_fff_fff,
																					    self.h[4] + e & 0xff_fff_fff,
																					)
														return ("{:08x}" * 5).format(*self.h  )






def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			b"""Test String"""
							assert SHAaHash(SCREAMING_SNAKE_CASE__       ).final_hash() == hashlib.shaa(SCREAMING_SNAKE_CASE__       ).hexdigest()  # noqa: S324





def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			argparse.ArgumentParser(description="""Process some strings or files"""       )
							parser.add_argument(
							    """--string"""   ,			dest="""input_string"""   ,			default="""Hello World!! Welcome to Cryptography"""   ,			help="""Hash the string"""   ,			)
							parser.add_argument("""--file"""   ,			dest="""input_file"""   ,			help="""Hash contents of a file"""       )
							UpperCamelCase__				     =			parser.parse_args()
							UpperCamelCase__				     =			args.input_string
							# In any case hash input should be a bytestring
							if args.input_file:
														with open(args.input_file   ,			"""rb"""       ) as f:
																					UpperCamelCase__				     =			f.read()
							else:
														UpperCamelCase__				     =			bytes(SCREAMING_SNAKE_CASE__   ,			"""utf-8"""       )
							print(SHAaHash(SCREAMING_SNAKE_CASE__       ).final_hash()       )


if __name__ == "__main__":
	main()
	import doctest

	doctest.testmod()











import math





def     _UpperCamelCase     (a__   :int       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[True] * n
							UpperCamelCase__				     =			False
							UpperCamelCase__				     =			False
							UpperCamelCase__				     =			True

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

							UpperCamelCase__				     =			[2]

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

							return primes





def     _UpperCamelCase     (a__   :int = 9999_6666_3333       ):






							"""simple docstring"""





							UpperCamelCase__				     =			math.floor(math.sqrt(a__       )       ) + 100
							UpperCamelCase__				     =			prime_sieve(a__       )

							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			primes[prime_index]

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

														UpperCamelCase__				     =			last_prime**2
														UpperCamelCase__				     =			next_prime**2

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

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

							return matches_sum


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




