n = int(input())
str = input()
new_str = ''
for i in range(len(str)):
    new_str += str[i]
    if i + 1 < len(str):
        if str[i] == ')' and str[i+1] == '(':
            new_str += '*'
        elif str[i] == '(' and str[i+1] == ')':
            new_str += '1'
        elif str[i] == ')' and str[i+1] == ')':
            new_str += '+'
            new_str += '1'
print(eval(new_str))

# ((())(()))