


'''simple docstring'''

import os

# Precomputes a list of the 100 first triangular numbers
_UpperCAmelCase				: Optional[Any]							    =				[int(0.5 * n * (n + 1)) for n in range(1, 1_0_1)]

def 							__magic_name__(						):
						__lowerCAmelCase							       =				os.path.dirname(os.path.realpath(lowerCamelCase))
						__lowerCAmelCase							       =				os.path.join(lowerCamelCase,				'''words.txt''')

						__lowerCAmelCase							       =				''''''
						with open(lowerCamelCase) as f:
												__lowerCAmelCase							       =				f.readline()

						__lowerCAmelCase							       =				[word.strip('''"''') for word in words.strip('''\r\n''').split(''',''')]
						__lowerCAmelCase							       =				[
						    word
						    for word in [sum(ord(lowerCamelCase) - 6_4 for x in word) for word in words]
						    if word in TRIANGULAR_NUMBERS
						]
						return len(lowerCamelCase)


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





'''simple docstring'''

from string import ascii_uppercase

_UpperCAmelCase				: Optional[int]							    =				{char: i for i, char in enumerate(ascii_uppercase)}
_UpperCAmelCase				: Optional[int]							    =				dict(enumerate(ascii_uppercase))

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				len(lowerCamelCase)
						__lowerCAmelCase							       =				0
						while True:
												if x == i:
																		__lowerCAmelCase							       =				0
												if len(lowerCamelCase) == len(lowerCamelCase):
																		break
												key += key[i]
												i += 1
						return key

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				''''''
						__lowerCAmelCase							       =				0
						for letter in message:
												if letter == " ":
																		cipher_text += " "
												else:
																		__lowerCAmelCase							       =				(dicta[letter] - dicta[key_new[i]]) % 2_6
																		i += 1
																		cipher_text += dicta[x]
						return cipher_text

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				''''''
						__lowerCAmelCase							       =				0
						for letter in cipher_text:
												if letter == " ":
																		or_txt += " "
												else:
																		__lowerCAmelCase							       =				(dicta[letter] + dicta[key_new[i]] + 2_6) % 2_6
																		i += 1
																		or_txt += dicta[x]
						return or_txt

def 							__magic_name__(						):
						__lowerCAmelCase							       =				'''THE GERMAN ATTACK'''
						__lowerCAmelCase							       =				'''SECRET'''
						__lowerCAmelCase							       =				generate_key(lowerCamelCase,				lowerCamelCase)
						__lowerCAmelCase							       =				cipher_text(lowerCamelCase,				lowerCamelCase)
						print(F"""Encrypted Text = {s}""")
						print(F"""Original Text = {original_text(lowerCamelCase,				lowerCamelCase)}""")


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()

