str1 = '1 2 3 4 5 6 7 8 9 0 + - * / ) ( ] [ } {'
x1 = input()
for word in x1:
    if word not in str1:
        print('error')
        break
    else:
        x1 = x1.replace('[','(')
        x1 = x1.replace(']',')')
        x1 = x1.replace('{','(')
        x1 = x1.replace('}',')')
        res = eval(x1)
        print(int(res) if res == int(res) else res)
        break