

UpperCAmelCase__     = {
    "a": "AAAAA",
    "b": "AAAAB",
    "c": "AAABA",
    "d": "AAABB",
    "e": "AABAA",
    "f": "AABAB",
    "g": "AABBA",
    "h": "AABBB",
    "i": "ABAAA",
    "j": "BBBAA",
    "k": "ABAAB",
    "l": "ABABA",
    "m": "ABABB",
    "n": "ABBAA",
    "o": "ABBAB",
    "p": "ABBBA",
    "q": "ABBBB",
    "r": "BAAAA",
    "s": "BAAAB",
    "t": "BAABA",
    "u": "BAABB",
    "v": "BBBAB",
    "w": "BABAA",
    "x": "BABAB",
    "y": "BABBA",
    "z": "BABBB",
    " ": " ",
}


UpperCAmelCase__     = {value: key for key, value in encode_dict.items()}





def 							A			(  _UpperCAmelCase       :     str					)       ->				str:







			'''simple docstring'''
			_UpperCAmelCase	 =     ''''''
			for letter in word.lower():
						if letter.isalpha() or letter == " ":
									encoded += encode_dict[letter]
						else:
									raise Exception('encode() accepts only letters of the alphabet and spaces'					)
			return encoded





def 							A			(  _UpperCAmelCase       :     str					)       ->				str:







			'''simple docstring'''




			if set(__A					) - {"A", "B", " "} != set():
						raise Exception('decode() accepts only \'A\', \'B\' and spaces'					)
			_UpperCAmelCase	 =     ''''''
			for word in coded.split():
						while len(__A					) != 0:
									decoded += decode_dict[word[:5]]
									_UpperCAmelCase	 =     word[5:]
						decoded += " "
			return decoded.strip()


if __name__ == "__main__":
							from doctest import testmod

							testmod()





import os

# Precomputes a list of the 100 first triangular numbers
UpperCAmelCase__     = [int(0.5 * n * (n + 1)) for n in range(1, 101)]





def 							A			(  )       ->				List[str]:







			'''simple docstring'''
			_UpperCAmelCase	 =     os.path.dirname(os.path.realpath(_UpperCAmelCase					)					)
			_UpperCAmelCase	 =     os.path.join(_UpperCAmelCase							,     'words.txt'					)

			_UpperCAmelCase	 =     ''
			with open(_UpperCAmelCase					) as f:
						_UpperCAmelCase	 =     f.readline()

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


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