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.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

import static java.lang.Math.abs;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		char s[] = sc.nextLine().toCharArray();

		int n = s.length;
		
		int openingBrIndx[] = new int[n];
		Arrays.fill(openingBrIndx, -1);
		int fartherstOpBr[] = new int[n];
		Arrays.fill(fartherstOpBr, -1);
		Stack<Integer> st = new Stack<Integer>();
		
		if(s[0] == '(')
			st.push(0);
		
		int freq[] = new int[1000_001];
		
		for(int i = 1; i < n; ++i)
		{
			if(s[i] == '(')
				st.push(i);
			else
			{
				if(!st.isEmpty())
				{
					fartherstOpBr[i] = openingBrIndx[i] = st.pop();
					if(openingBrIndx[i] > 0 && s[openingBrIndx[i] - 1] == ')' && openingBrIndx[openingBrIndx[i] - 1] >= 0)
						fartherstOpBr[i] = Math.min(fartherstOpBr[i], fartherstOpBr[openingBrIndx[i] - 1]);
				}
			}
		}
		//System.out.println(Arrays.toString(fartherstOpBr));
		//System.out.println(Arrays.toString(openingBrIndx));
		int max = 0;
		
		for(int i = 0; i < n; ++i)
		{
			if(s[i] == ')' && fartherstOpBr[i] >= 0)
			{
				max = Math.max(max, i - fartherstOpBr[i] + 1);
				freq[i - fartherstOpBr[i] + 1]++;
			}
		}
		
		if(max == 0)
			out.println("0 1");
		else
			out.println(max + " " + freq[max]);
		
		// (()()()()(()
		
		out.flush();
		out.close();
	}

	static class Pair implements Comparable<Pair> {
		int a, b;
		
		public Pair(int x, int y) {
			a = x; b = y;
		}
		
		@Override
		public int compareTo(Pair p) {
			return (a == p.a)?b - p.b:a - p.a; 
		}
		
		@Override
		public String toString() {
			return a + " " + b;
		}
	}
	
	static class Scanner{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}
	}
}