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.*;
import java.util.*;

public class Main
{
	public static void main(String[] args) throws IOException
	{
		new Main().run();
	}
	void run() throws IOException
	{
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader input = new BufferedReader(new FileReader("input.in"));
		char[] cs = input.readLine().toCharArray();
		
		int n = cs.length;
		ArrayList<Integer>[] list = new ArrayList[2 * n + 1];
		for(int i = 0; i <= n << 1; i++) list[i] = new ArrayList<Integer>();
		int[] f = new int[n + 1];
		int[] a = new int[n + 1];
		int[] count = new int[n + 1];
		list[n].add(0);
		for(int i = 1; i <= cs.length; i++)
		{
			if(cs[i - 1] == '(') a[i] = a[i - 1] + 1;
			else a[i] = a[i - 1] - 1;
			int j = i - 1;
			while(j > 0 && a[i] <= a[j]) j = f[j];
			f[i] = j;
			
			int s = a[i] + n;
			int low = 0, high = list[s].size() - 1;
			while(low < high)
			{
				int mid = (low + high) >> 1;
				if(list[s].get(mid) < f[i]) low = mid + 1;
				else high = mid;
			}
			if(low < list[s].size() && list[s].get(low) >= f[i]) count[i - list[s].get(low)]++;
			list[s].add(i);
		}
		count[0]++;
		for(int i = n; i >= 0; i--)
			if(count[i] > 0)
			{
				System.out.println(i + " " + count[i]);
				break;
			}
	}
	void print(Object...o)
	{
		System.out.println(Arrays.deepToString(o));
	}
}