
'''simple docstring'''







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


class 						__UpperCAmelCase      :


							def __init__(       self    ,   lowerCAmelCase_  ):





								"""simple docstring"""






								_snake_case   						=		data
								_snake_case   						=		[0X6_7_4_5_2_3_0_1, 0XE_F_C_D_A_B_8_9, 0X9_8_B_A_D_C_F_E, 0X1_0_3_2_5_4_7_6, 0XC_3_D_2_E_1_F_0]


							@staticmethod
							def  lowerCamelCase				(       lowerCAmelCase_    ,   lowerCAmelCase_  ):





								"""simple docstring"""






								return ((n << b) | (n >> (32 - b))) & 0XF_F_F_F_F_F_F_F


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		B'\x80' + B'\x00' * (63 - (len(self.data  ) + 8) % 64)
								_snake_case   						=		self.data + padding + struct.pack('>Q'    ,   8 * len(self.data  )  )
								return padded_data


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






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


							def  lowerCamelCase				(       self    ,   lowerCAmelCase_  ):





								"""simple docstring"""






								_snake_case   						=		list(struct.unpack('>16L'    ,   lowerCAmelCase_  )  ) + [0] * 64
								for i in range(16    ,   80  ):
									_snake_case   						=		self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16])    ,   1  )
								return w




							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		self.padding()
								_snake_case   						=		self.split_blocks()
								for block in self.blocks:
									_snake_case   						=		self.expand_block(lowerCAmelCase_  )
									_snake_case						, _snake_case						, _snake_case						, _snake_case						, _snake_case   						=		self.h
									for i in range(0    ,   80  ):
										if 0 <= i < 20:
											_snake_case   						=		(b & c) | ((~b) & d)
											_snake_case   						=		0X5_A_8_2_7_9_9_9
										elif 20 <= i < 40:
											_snake_case   						=		b ^ c ^ d
											_snake_case   						=		0X6_E_D_9_E_B_A_1
										elif 40 <= i < 60:
											_snake_case   						=		(b & c) | (b & d) | (c & d)
											_snake_case   						=		0X8_F_1_B_B_C_D_C
										elif 60 <= i < 80:
											_snake_case   						=		b ^ c ^ d
											_snake_case   						=		0XC_A_6_2_C_1_D_6
										_snake_case						, _snake_case						, _snake_case						, _snake_case						, _snake_case   						=		(
										    self.rotate(lowerCAmelCase_    ,   5  ) + f + e + k + expanded_block[i] & 0XF_F_F_F_F_F_F_F,
										    a,
										    self.rotate(lowerCAmelCase_    ,   30  ),
										    c,
										    d,
										)
									_snake_case   						=		(
									    self.h[0] + a & 0XF_F_F_F_F_F_F_F,
									    self.h[1] + b & 0XF_F_F_F_F_F_F_F,
									    self.h[2] + c & 0XF_F_F_F_F_F_F_F,
									    self.h[3] + d & 0XF_F_F_F_F_F_F_F,
									    self.h[4] + e & 0XF_F_F_F_F_F_F_F,
									)
								return ("{:08x}" * 5).format(*self.h  )







def 				SCREAMING_SNAKE_CASE__	(   )       ->	Optional[Any]:
	_snake_case   						=		b'Test String'
	assert SHAaHash(__A	).final_hash() == hashlib.shaa(__A	).hexdigest()  # noqa: S324







def 				SCREAMING_SNAKE_CASE__	(   )       ->	Any:
	_snake_case   						=		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'	)
	_snake_case   						=		parser.parse_args()
	_snake_case   						=		args.input_string
	# In any case hash input should be a bytestring
	if args.input_file:
		with open(args.input_file			,				'rb'	) as f:
			_snake_case   						=		f.read()
	else:
		_snake_case   						=		bytes(__A			,				'utf-8'	)
	print(SHAaHash(__A	).final_hash()	)


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

					doctest.testmod()



'''simple docstring'''







from collections import defaultdict
from math import gcd







def 				SCREAMING_SNAKE_CASE__	(   __A = 1_500_000	)       ->	int:
	_snake_case   						=		defaultdict(__A	)
	_snake_case   						=		2
	while 2 * euclid_m * (euclid_m + 1) <= limit:
		for euclid_n in range((euclid_m % 2) + 1			,				__A			,				2	):
			if gcd(__A			,				__A	) > 1:
				continue
			_snake_case   						=		2 * euclid_m * (euclid_m + euclid_n)
			for perimeter in range(__A			,				limit + 1			,				__A	):
				frequencies[perimeter] += 1
		euclid_m += 1
	return sum(1 for frequency in frequencies.values() if frequency == 1	)


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

