//京东第一题
package com.exam.jingdong;

import java.util.Scanner;

public class Title01 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		System.out.println(getResult(str));
		sc.close();
	}

	private static int getResult(String str) {
		if("".equals(str)){
			return 1;
		}
		int length = str.length();
		char[] charArray = str.toCharArray();
		int count = 0;
		int result = 1;
		for(int i=0;i<length;i++){
			if(charArray[i]=='('){
				count++;
			}else{
				result*=count;
				count--;
			}
		}
		
		return result;
	}
}