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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Locale;
import java.util.Stack;
import java.util.StringTokenizer;

public class Main {

	private String s;
	private Stack<Integer> stc;
	private int[] c;
	private int[] d;
	private int len;

	private void solve() throws IOException {
		s = next();
		len = s.length();
		s = " " + s;

		stc = new Stack<Integer>();

		d = new int[len + 1];
		c = new int[len + 1];
		Arrays.fill(d, -1);
		Arrays.fill(c, -1);

		for (int i = 1; i <= len; i++) {
			if (s.charAt(i) == '(') {
				stc.add(i);
			} else {
				if (!stc.isEmpty()) {
					d[i] = stc.pop();
					if (d[d[i] - 1] != -1) {
						c[i] = c[d[i] - 1];
					} else {
						c[i] = d[i];
					}
				}
			}
		}

		int count = 0;
		int max = 0;

		for (int i = len; i > 0;) {
			if (c[i] != -1) {
				if (i - c[i] + 1 == max) {
					count++;
				}
				if (i - c[i] + 1 > max) {
					max = i - c[i] + 1;
					count = 1;
				}
				i = c[i] - 1;
			} else {
				i--;
			}
		}
		out.println(max == 0 ? "0  1" : max + " " + count);
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private Main() throws IOException {
		Locale.setDefault(Locale.ENGLISH);
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		eat("");
		solve();
		in.close();
		out.close();
	}

	private void eat(String s) {
		st = new StringTokenizer(s);
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

	String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			eat(line);
		}
		return st.nextToken();
	}

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

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

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

}