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.util.*;
import java.io.*;
 public class C5
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		char sequence[]=line.toCharArray();
		Stack<Integer> s = new Stack<Integer>();
		int n = sequence.length;
		boolean valid[] = new boolean[n];
		Arrays.fill(valid,false);
		for(int i = 0;i < n; ++i)
		{
//pushing to stack "("			
			if(sequence[i]=='(')
			{
				s.push(i);
			}
//if the stack isn't empty and there is ")" then pop the stack
//and get indexes in sequence of parenthesis 
			else if(!s.empty())
			{
				valid[i]=true;
				valid[s.pop()]=true;
			}
		}
		int max = 0; //number of couples with max number of paranthesis
		int count = 1;// number of couples
		for(int i = 0; i < n; ++i)
		{
			if(valid[i])
			{
				int j = i+1;
//while there is no gap between valid parenthesis they form the sequence				
				while(j < n && valid[j])
					++j;
				int size = j-i;
//if the size is bigger than previous couples, when it becomes max
//and starts to count from 1 number of biggest sequence				
				if(size > max)
				{
					max = size;
					count = 1;
				}
//else it counts if the size coincides with the size of biggest sequence				
				else if(size == max)
				{
					count++;
				}
				i = j;
			}
		}
		System.out.println(max+" "+count);
	}
}