import re
s=input()
s=re.sub("{|\[", "(", s)
s=re.sub("}|\]", ")", s)
print(int(eval(s)))