#人生苦短,我用python
str1 = input()
str1 = str1.replace('{', '(').replace('}', ')').replace('[', '(').replace(']', ')')
print(int(eval(str1)))