#!/usr/sbin/python
# -*- coding: utf-8 -*-
'''
输入一个表达式(用字符串表示),求这个表达式的值。
'''

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