def split(source, input):
if source[0].isdigit() and source[1].isdigit(): # 10이면
input.append(source[0] + source[1])
input.append(source[2])
if len(source) > 3:
if source[3].isdigit():
input.append("!")
source = source.replace(source[0] + source[1] + source[2], "")
else:
input.append(source[3])
source = source.replace('10' + source[2] + source[3], "")
else:
input.append("!")
else: # 10이 아니면
input.append(source[0])
input.append(source[1])
if len(source) >= 4 and source[1] != 0:
if source[2].isdigit():
input.append("!")
source = source.replace(source[0] + source[1], "")
else:
input.append(source[2])
source = source.replace(source[0] + source[1] + source[2], "")
else: # 결과3 분석
if len(source) < 3:
input.append("!")
else:
input.append(source[2])
return source, input

def solution(dartResult):
first = []
second = []
third = []

dartResult, first = split(dartResult, first)
dartResult, second = split(dartResult, second)
dartResult, third = split(dartResult, third)
print(first,second,third)
print(dartResult, first, second, third)
a = pow(int(first[0]), 1 if first[1] == "S" else 2 if first[1] == "D" else 3) * (-1 if first[2] == "#" else 2 if first[2] == "*" else 1) * (2 if second[2] == "*" else 1)
b = pow(int(second[0]), 1 if second[1] == "S" else 2 if second[1] == "D" else 3) * (-1 if second[2] == "#" else 2 if second[2] == "*" else 1) * (2 if third[2] == "*" else 1)
c = pow(int(third[0]), 1 if third[1] == "S" else 2 if third[1] == "D" else 3) * (-1 if third[2] == "#" else 2 if third[2] == "*" else 1)
answer = a+b+c
print(a,b,c,answer)
return answer



와아아아아앙~~

와아아아아아아아아앙~~~





꺄~~~

갸아아아~~

꺄꺄~~~

우와아아아~~~

우와아아아아앙ㅇ~~~~

우아아아앙~~

우와~~~~~

앙으으ㅏ아아~~~~~~~~~~~~