



import os






def 					__lowerCAmelCase		(  )  ->						Union[str, Any]:
					with open(os.path.dirname(__lowerCamelCase	) + """/p022_names.txt"""	) as file:
										__lowerCAmelCase	   =       str(file.readlines()[0]	)
										__lowerCAmelCase	   =       names.replace("""\""""				,   """"""	).split(""","""	)

					names.sort()

					__lowerCAmelCase	   =       0
					__lowerCAmelCase	   =       0

					for i, name in enumerate(__lowerCamelCase	):
										for letter in name:
															name_score += ord(__lowerCamelCase	) - 64

										total_score += (i + 1) * name_score
										__lowerCAmelCase	   =       0
					return total_score


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









def 					__lowerCAmelCase		(  __lowerCamelCase	:    List[Any]	)  ->						Any:
					__lowerCAmelCase	   =[]
					__lowerCAmelCase	   =set({"""(""", """[""", """{"""}	)
					__lowerCAmelCase	   =set({""")""", """]""", """}"""}	)
					__lowerCAmelCase	   ={"""{""": """}""", """[""": """]""", """(""": """)"""}

					for i in range(len(__lowerCamelCase	)	):
										if s[i] in open_brackets:
															stack.append(s[i]	)

										elif s[i] in closed_brackets and (
										    len(__lowerCamelCase	) == 0 or (len(__lowerCamelCase	) > 0 and open_to_closed[stack.pop()] != s[i])
										):
															return False

					return len(__lowerCamelCase	) == 0






def 					__lowerCAmelCase		(  )  ->						List[str]:
					__lowerCAmelCase	   =input("""Enter sequence of brackets: """	)
					if is_balanced(__lowerCamelCase	):
										print(__lowerCamelCase				,   """is balanced"""	)
					else:
										print(__lowerCamelCase				,   """is not balanced"""	)


if __name__ == "__main__":
				main()




