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

public class Main {

    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        FastPrinter out = new FastPrinter(System.out);
        char[] brs = in.next().toCharArray();
        boolean[] closed = new boolean[brs.length];
        Stack<Integer> s = new Stack<Integer>();
        for (int i = 0; i < brs.length; i++) {
            if (brs[i] == '(') {
                s.push(i);
            } else if (s.size() != 0) {
                closed[s.pop()] = true;
                closed[i] = true;
            }
        }
        int l = 0, id = 1, lt = 0, idt = 0,c = 0;
        for (int i = 0; i < closed.length; i++) {
            if (closed[i]) {
                lt++;
            } else {
                if (lt > l) {
                    l = lt;
                    c = 1;
                }else if(lt == l){
                    c++;
                }
                lt = 0;
            }
        }
        if (lt > l) {
            l = lt;
            c = 1;
        }else if(lt == l){
            c++;
        }
        if (l == 0) {
            out.println("0 1");
        } else
            out.println(l + " " + c);
        out.close();
    }
}

class pair {
    char c;
    int e;

    public pair(char c, int e) {
        this.e = e;
        this.c = c;
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

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

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

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

    public BigInteger nextBigInt() {
        return new BigInteger(next());
    }
}

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}