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 l{
    static class pair implements Comparable<pair>{
        long num,id;
        pair(int a ,int b){
            num=a;
            id=b;
        }

        @Override
        public int compareTo(pair pair) {
            return (int) (pair.id-id);
        }
    }

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        char[]s=sc.nextLine().toCharArray();
        int[]a= new int[s.length];
        Arrays.fill(a,-1);
        Stack<Integer>q= new Stack<>();
        for (int i =0;i<s.length;i++){
            if (s[i]=='(')q.add(i);
            else {
                if (!q.isEmpty()){
                    a[q.pop()]=i;
                }
            }
        }
        int max=0;
        int c=1;
      //  pw.println(Arrays.toString(a));
        for (int i =0;i<s.length;i++){
            if (a[i]!=-1){
                int l =0;
                for (;i<s.length;){
                    if (a[i]==-1)break;
                    l+=a[i]-i+1;
                    i=a[i]+1;
                }
                if (l==max)c++;
                if (l>max){
                    max=l;
                    c=1;
                }
            }
        }
        pw.println(max+" "+c);
        pw.flush();
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(FileReader r){
            br= new BufferedReader(r);
        }
        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        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
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }

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


    }
}