for s in open(0):m='mysterious';s=[('*'in x)-1if m in x else eval(x)for x in s.split("+")];print(m*-min(s)or sum(s))