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 longestbrackets {
 	
 	public static void main(String[] args) throws Exception {
 		if ("Satayev".equals(System.getProperty("user.name"))) {
			long start = System.nanoTime();
			new longestbrackets().solve(new FileInputStream("input"));
			System.err.printf("Time elapsed: %d ms.\n", (System.nanoTime()-start)/1000000);
		}
		else
			new longestbrackets().solve(System.in);
 	}

 	void solve(InputStream is) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(is));
		
		char[] a = in.readLine().toCharArray();
		
		int max = -1, count = 0, balance = 0, l = 0;
		
		for (int i = 0; i < a.length; i++) {
			if (a[i] == '(')
				balance++;
			if (a[i] == ')')
				balance--;
			if (balance == 0) {
				max = Math.max(i-l, max);
			}
			if (balance < 0) {
				balance = 0;
				l = i+1;
			}
		}
			
		balance = l = 0;
		for (int i = 0; i < a.length; i++) {
			if (a[i] == '(')
				balance++;
			if (a[i] == ')')
				balance--;
			if (balance == 0) {
				if (i - l == max)
					count++;
			}
			if (balance < 0) {
				balance = 0;
				l = i+1;
			}
		}
		
		if (max++ == -1)
			count = 1;
		
		int max2 = -1, count2 = 0;
		balance = 0;
		l = a.length-1;
		for (int i = a.length-1; i >= 0; i--) {
			if (a[i] == ')')
				balance++;
			if (a[i] == '(')
				balance--;
			if (balance == 0) {
				max2 = Math.max(l-i, max2);
			}
			if (balance < 0) {
				balance = 0;
				l = i-1;
			}
		}
			
		balance = 0;
		l = a.length-1;
		for (int i = a.length-1; i >= 0; i--) {
			if (a[i] == ')')
				balance++;
			if (a[i] == '(')
				balance--;
			if (balance == 0) {
				if (l-i == max2)
					count2++;
			}
			if (balance < 0) {
				balance = 0;
				l = i-1;
			}
		}
		
		if (max2++ == -1)
			count2 = 1;

		if (max > max2) {
			max2 = max;
			count2 = count;
		}
		if (max == max2) {
			count2 = Math.max(count, count2);
		}
		
		System.out.println(max2 + " " + count2);
 	}

}