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

public class C {
    public static void main(String[] args) throws IOException {
        FastScanner fs=new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        // int T = 1;

        // int T=fs.nextInt();
        // for (int tt=0; tt<T; tt++) {
            
        // }
        String s = fs.next();

        Stack<Integer> st = new Stack();
        int maxLen = 0;
        int count = 0;
        st.push(-1);

        for (int i=0; i<s.length(); i++) {
            Character cur = s.charAt(i);
            if (cur==')') {
                if (st.peek()==-1) {
                    st.push(i);
                    continue;
                }
                if (s.charAt(st.peek())==')') {
                    st.push(i);
                    continue;
                }

                // System.out.println("    idx: "+i);
                // System.out.println("    poppin: "+st.peek());
                int last = st.pop();
                int len = i-st.peek();
                // System.out.println("    len: "+len);

                if (len>maxLen) {
                    maxLen=len;
                    count=1;
                }
                else if (len==maxLen) {
                    count++;
                }
            }
            if (cur=='(') {
                st.push(i);
            }
        }

        out.println(maxLen+" "+(maxLen==0?1:count));
        out.close();
    }

    static final Random random=new Random();
    
    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort 
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }
    
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }

}