def main():
    a = int(input())
    text = input()[:a]
    i = 0
    while i < len(text) - 1:
        if text[i] == "(" and text[i+1] == ")":
            text = text[:i+1] + "1" + text[i+1:]
        elif text[i] == ")" and text[i+1] == ")":
            text = text[:i + 1] + "+1" + text[i + 1:]
        elif text[i] == ")" and text[i + 1] == "(":
            text = text[:i + 1] + "*" + text[i + 1:]
        i += 1
    print(eval(text))


main()
