input()
s=input()

t = s[0]
for i in range(len(s)-1):
    if s[i] == ')' and s[i+1] == '(':
        t += '*('
    elif s[i] == '(' and s[i+1] == ')':
        t += '1)'
    elif s[i] == ')' and s[i+1] == ')':
        t += '+1)'
    else:
        t += s[i+1]

print(eval(t))