QUESTION_NUMBER = 4

def ReadFile():
    for Line in open("data%s.txt"%QUESTION_NUMBER,"r"):
        yield Line.strip()

Next = ReadFile().next


#=============

def WriteLine(Line):
    open("out%s.txt"%QUESTION_NUMBER,"a").write(str(Line) + "\n")
    
class Int(object):
    
    __slots__ = ("val",)
    def __init__(self, val):
        self.val = int(val)
        
    def __add__(self,other):
        return Int(self.val + other.val)
    def __sub__(self,other):
        return Int(self.val - other.val)
    def __mul__(self,other):
        return Int(self.val * other.val)
    def __div__(self,other):
        return Int(self.val / other.val)
    def __xor__(self,other):
        return Int(
            "%s%s"%(abs(self.val) ,abs(other.val))
            
            )
    
for QQ in xrange(5):
    Org = Next().replace(" ","") + ' '
    
    
    Exp = ""
    
    IsNum = False
    for i in xrange(len(Org)-1):
        Chr = Org[i]
        if IsNum:
            if Chr.isdigit():
                Exp += Chr
            else:
                IsNum = False
                Exp += ")" + Chr
        else:
            if (Chr=='-' and Org[i+1].isdigit()) or Chr.isdigit():
                Exp += "Int(" + Chr
                IsNum =True
            else:
                Exp += Chr
    if IsNum:
        Exp += ")"
    
    WriteLine(eval(Exp).val)
    
