Problem: This is yet another problem dealing with regular bracket sequences.

We should remind you that a bracket sequence is called regular, if by inserting «+» and «1» into it we can get a correct mathematical expression. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not. 

You are given a string of «(» and «)» characters. You are to find its longest substring that is a regular bracket sequence. You are to find the number of such substrings as well.

Input

The first line of the input file contains a non-empty string, consisting of «(» and «)» characters. Its length does not exceed 106.

Output

Print the length of the longest substring that is a regular bracket sequence, and the number of such substrings. If there are no such substrings, write the only line containing "0 1".

Examples

Input

)((())))(()())


Output

6 2


Input

))(


Output

0 1

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) throws IOException {
		/* Read in from console */
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter writer = new PrintWriter(System.out);

		char[] data = reader.readLine().toCharArray();
		int openb = 0;
		int closeb = 0;
		int count = 0;
		int countb=0;
		int maxLength = 0;
		int maxLengthb = 0;
		int start = 0;
		int startb = data.length;
		int z = data.length-1;
		int i = 0;
		
		for(i=0; i<data.length; i++){
			if(data[i] == '(')
				openb++;
			else
				openb--;
			
			if(data[z] == ')')
				closeb++;
			else
				closeb--;
			
			if(openb==0){
				if(maxLength == i-start)
					count++;
				else if(maxLength < i-start){
					maxLength = i-start;
					count = 1;
				}
			}
			
			if(closeb==0){
				if(maxLengthb == startb-z)
					countb++;
				else if(maxLengthb < startb-z){
					maxLengthb = startb-z;
					countb = 1;
				}
			}
	
			if(openb<0){
				openb=0;
				start = i;
			}
			
			if(closeb<0){
				closeb=0;
				startb = z;
			}
			z--;
		}
		
		if(maxLength == 0)
			count = 1;
		
		if(maxLengthb == 0)
			countb = 1;
		
		if(maxLength == data.length-1)
			maxLength++;
		
		
		if(maxLength >= maxLengthb)
			writer.println(maxLength + " " +count);
		else
			writer.println(maxLengthb + " " + countb);

		writer.close();
	}
}