lit=list(input().split(';'))
a=0
b=0
dic={"A":-1,"D":1,"W":1,"S":-1}
for x in lit:
if len(x)>1 and x[0] in dic and x[1:].isdigit():
if x[0] in ["A","D"]:
a+=dic[x[0]]*int(x[1:])
else:
b+=dic[x[0]]*int(x[1:])
print(f"{a},{b}")

京公网安备 11010502036488号