n = int(input())
s = input()
res = [s[0]]
for c in s[1:]:
	if res[-1] == ")" and c == "(":
		res.append("*")
	elif res[-1] == "(" and c == ")":
		res.append("1")
	elif res[-1] == ")" and c == ")":
		res.append("+1")
	res.append(c)
print(eval("".join(res)))
