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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class C implements Runnable {
	BufferedReader in;
	BufferedWriter out;
	
	public void solve() throws Exception 
	{
		String s = readword();
		int n = s.length();
		int stack[] = new int[n];
		int top = 0;
		int length = 0;
		int count = 1;
		boolean isBreak = false;
		for( int i = 0; i < n; i++ ) {
			switch(s.charAt(i)) {
			case '(':
				if( i == 0 || s.charAt(i-1) == '(' || isBreak) {
					stack[top] = i;
				}
				top++;
				break;
			case ')':
			{
				if( top != 0 ) {
					top--;
					int len = i - stack[top] + 1;
					if( len > length ) {
						length = len;
						count = 1;
					} else if( len == length ) {
						count++;
					}
					isBreak = false;
				} else isBreak = true;
			}
			break;
			}
		}
		out.write(length + " " + count + "\n");
	}
	
	public String readword() throws IOException {
		int c = in.read();
		while( c >= 0 && c <= ' ' ) c = in.read();
		if( c < 0 ) return "";
		StringBuilder bld = new StringBuilder();
		while( c > ' ' ) {
			bld.append((char)c);
			c = in.read();
		}
		return bld.toString();
	}
	
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			solve();
			out.flush();
		} catch( Exception e ) {
			e.printStackTrace();
			System.exit(1);
		}
	}
	public static void main(String[] args) {
		new Thread(new C()).start();
	}
}