s = input()
l = ["{","}","[","]"]
for i in range(4):
    if l[i] == "{"&nbs***bsp;l[i] == "[":
        s=s.replace(l[i], "(")
    else:
        s=s.replace(l[i], ")")
print(int(eval(s)))
# print(eval(s)) 
eval()简单粗暴