"""simple docstring"""


def 					a__					(					__SCREAMING_SNAKE_CASE = 4_0_0_0_0_0_0				)			->			int:

		if n <= 1:
				return 0
		__lowerCAmelCase: Any					   =    0
		__lowerCAmelCase: Tuple					   =    2
		__lowerCAmelCase: Tuple					   =    0
		while 4 * b + a <= n:
				__lowerCAmelCase: List[Any]					   =    b, 4 * b + a
				count += a
		return count + b


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





"""simple docstring"""


import random
import sys

__A		     =    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"






def 					a__					(					)			->			None:
		__lowerCAmelCase: int					   =    input("Enter message: "				)
		__lowerCAmelCase: Any					   =    "LFWOAYUISVKMNXPBDCRJTQEGHZ"
		__lowerCAmelCase: int					   =    input("Encrypt/Decrypt [e/d]: "				)

		check_valid_key(__SCREAMING_SNAKE_CASE				)

		if resp.lower().startswith("e"				):
				__lowerCAmelCase: Tuple					   =    "encrypt"
				__lowerCAmelCase: int					   =    encrypt_message(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)
		elif resp.lower().startswith("d"				):
				__lowerCAmelCase: str					   =    "decrypt"
				__lowerCAmelCase: List[str]					   =    decrypt_message(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)

		print(F"\n{mode.title()}ion: \n{translated}"				)






def 					a__					(					__SCREAMING_SNAKE_CASE				)			->			None:
		__lowerCAmelCase: List[Any]					   =    list(__SCREAMING_SNAKE_CASE				)
		__lowerCAmelCase: Optional[int]					   =    list(__SCREAMING_SNAKE_CASE				)
		key_list.sort()
		letters_list.sort()

		if key_list != letters_list:
				sys.exit("Error in the key or symbol set."				)






def 					a__					(					__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)			->			str:
		return translate_message(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE      ,				"encrypt"				)






def 					a__					(					__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)			->			str:
		return translate_message(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE      ,				"decrypt"				)






def 					a__					(					__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)			->			str:
		__lowerCAmelCase: Union[str, Any]					   =    ""
		__lowerCAmelCase: List[str]					   =    LETTERS
		__lowerCAmelCase: Optional[int]					   =    key

		if mode == "decrypt":
				__lowerCAmelCase   ,				__lowerCAmelCase: Optional[int]					   =    chars_b, chars_a

		for symbol in message:
				if symbol.upper() in chars_a:
						__lowerCAmelCase: Union[str, Any]					   =    chars_a.find(symbol.upper()				)
						if symbol.isupper():
								translated += chars_b[sym_index].upper()
						else:
								translated += chars_b[sym_index].lower()
				else:
						translated += symbol

		return translated






def 					a__					(					)			->			str:
		__lowerCAmelCase: int					   =    list(__SCREAMING_SNAKE_CASE				)
		random.shuffle(__SCREAMING_SNAKE_CASE				)
		return "".join(__SCREAMING_SNAKE_CASE				)


if __name__ == "__main__":
			main()


