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.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;

public class p5c {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String ss = in.next();

        char[] s = ss.toCharArray();

        Stack<Integer> st = new Stack<Integer>();
        LinkedList<seq> l = new LinkedList<seq>();
        for (int i = 0; i < s.length; i++) {

            if (s[i] == '(') {
                st.push(i);
            }
            if (s[i] == ')') {
                if (st.isEmpty()) {
                    continue;
                }
                int where = st.pop();
                l.add(new seq(where, i));
            }
        }
        seq[] all = new seq[l.size()];
        l.toArray(all);

        if (all.length == 0) {
            System.out.println("0 1");
            return;
        }

        Arrays.sort(all);
        /*for (int i = 0; i < all.length; i++) {
            System.out.println(all[i].x + " " + all[i].y);
        }*/
        int now = all[0].y - all[0].x + 1;
        int max = now;
        int prev = 0;
        for (int i = 1; i < all.length; i++) {
            if (all[i].x > all[prev].x && all[i].y < all[prev].y) {
                continue;
            }
            if (all[i].x > all[prev].x && all[i].x < all[prev].y
                    && all[i].y > all[prev].y) {
                System.out.println("howcome");
                continue;
            }
            if (all[i].x == all[prev].y + 1) {
                now += all[i].y - all[i].x + 1;
                max = Math.max(max, now);
                prev = i;
                continue;
            }
            now = all[i].y - all[i].x + 1;
            max = Math.max(max, now);
            prev = i;
        }

        int count = 0;
        now = all[0].y - all[0].x + 1;
        if(now == max)
            count++;
        prev = 0;
        for (int i = 1; i < all.length; i++) {
            if (all[i].x > all[prev].x && all[i].y < all[prev].y) {
                continue;
            }
            if (all[i].x > all[prev].x && all[i].x < all[prev].y
                    && all[i].y > all[prev].y) {
                System.out.println("howcome");
                continue;
            }
            if (all[i].x == all[prev].y + 1) {
                now += all[i].y - all[i].x + 1;
                if (now == max)
                    count++;
                prev = i;
                continue;
            }
            now = all[i].y - all[i].x + 1;
            if (now == max)
                count++;
            prev = i;
        }
        System.out.println(max + " " + count);
    }
}

class seq implements Comparable<seq> {
    int x, y;

    public seq(int a, int b) {
        x = a;
        y = b;
    }

    public int compareTo(seq o) {
        return x - o.x;
    }

}