def fi(s,b,e):
income=0
i=b
while i<=e:
if s[i]=="A":
income+=
i+=2
elif s[i]=="B":
income+=int(s[i+1:i+3])*300
i+=3
elif s[i]=="C":
income+=int(s[i+1:i+3])*200
i+=3
return income
s=input("请输入订单码:")
flag=False
for i in range(len(s)):
if s[i]=="-" and not flag:
flag=True
elif s[i]=="-":
q=i
elif s[i]==",":
e=i
total=fi(s,p+1,e- 1)
total+=fi(s, ,len(s)- 1)
print(total)