while 1:
    try:
        s=input()
        s=s.replace("{","(")
        s=s.replace("}",")")
        s=s.replace("[","(")
        s=s.replace("]",")")
        print(int(eval(s)))
    except:
        break