import sys,re
print(sum(int(a)*int(b) for a,b in re.findall(r"mul\((\d+),(\d+)\)",sys.stdin.read())))
