import java.util.Scanner; public class Beth { static String line; static int index; public static void main(String[] args) { var sc = new Scanner(System.in); int lenght = sc.nextInt(); sc.nextLine(); index = 0; line = sc.nextLine(); System.out.println(cal()); } public static long cal() { index++; long value = 0; char curr = line.charAt(index); while (line.charAt(index) != ')') { if (value == 0) { value = cal(); } else { value *= cal(); } } index++; return value + 1; } }