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.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.Stack;
import java.util.StringTokenizer;

public class codeforcesreturn {
	static class pair implements Comparable<pair> {
		int left;
		int right;

		public pair(int l, int r) {
			left = l;
			right = r;
		}

		public int compareTo(pair p) {
			return left - p.left;
		}
	}

	static ArrayList<Integer>[] adjlist;
	static int[][] adjmatrix;
	static int[][] adjmatrix2;
	static boolean[] vis;
	static boolean[] intialvis;
	static boolean[] vis2;
	static int[] counter;
	static int V, E;
	static Stack<Integer> st;
	static ArrayList<Integer> arrylist;
	static boolean flag;
	static int[] dx = new int[] { 1, -1, 0, 0 };
	static int[] dy = new int[] { 0, 0, 1, -1 };
	static int[] Arr;
	static PrintWriter pw;

	static long bin(long d, int startindex, int[] Arr) {
		int left = startindex + 2;
		int right = Arr.length - 1;
		int mid;
		int ans = 0;
		while (left <= right) {
			mid = (left + right) / 2;
			if (Arr[mid] - Arr[startindex] <= d) {
				ans = mid;
				left = mid + 1;
			} else {
				right = mid - 1;
			}
		}
		// System.out.println(ans);
		if (ans == 0)
			return 0;
		long dif = ans - startindex - 1;
		return (dif + 1) * dif / 2;
	}

	static boolean check(int k, int w, int[] Arr) {
		int n = Arr.length;
		HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
		int c = 0;
		for (int i = 0; i < w; i++) {
			c += hm.getOrDefault(Arr[i] * k, 0);
			if (Arr[i] % k == 0)
				c += hm.getOrDefault(Arr[i] / k, 0);
			hm.put(Arr[i], hm.getOrDefault(Arr[i], 0) + 1);
		}
		if (c == 0)
			return true;
		for (int i = 0; i < n - w; i++) {
			// remove
			c -= hm.getOrDefault(Arr[i] * k, 0);
			if (Arr[i] % k == 0)
				c -= hm.getOrDefault(Arr[i] / k, 0);
			if (hm.get(Arr[i]) == 1)
				hm.remove(Arr[i]);
			else
				hm.put(Arr[i], hm.getOrDefault(Arr[i], 0) - 1);
			// add
			c += hm.getOrDefault(Arr[i + w] * k, 0);
			if (Arr[i + w] % k == 0)
				c += hm.getOrDefault(Arr[i + w] / k, 0);
			hm.put(Arr[i + w], hm.getOrDefault(Arr[i + w], 0) + 1);
			if (c == 0)
				return true;
		}
		return false;
	}

	static PriorityQueue<Long> pq;

	public static boolean ch(String str) {
		int four = 0;
		int seven = 0;
		for (int i = 0; i < str.length(); i++) {
			if (str.charAt(i) == '4')
				four++;
			else
				seven++;
		}
		return four == seven;
	}

	public static void gen(String str, int four, int seven) {

		if (four > 0)
			gen(str + "4", four - 1, seven);

		if (seven > 0)
			gen(str + "7", four, seven - 1);
		if (!str.equals(""))
			pq.add(Long.parseLong(str));
	}

	public static void main(String[] args) throws IOException, InterruptedException {
		pw = new PrintWriter(System.out);
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int x = 0;
		boolean[] Arr = new boolean[str.length()];
		for (int i = 0; i < str.length(); i++) {
			if (str.charAt(i) == '(') {
				x++;
			} else {
				if (x == 0)
					Arr[i] = true;
				else
					x--;
			}
		}
		 x = 0;
		for (int i = str.length()-1; i >= 0; i--) {
			if (str.charAt(i) == ')') {
				x++;
			} else {
				if (x == 0)
					Arr[i] = true;
				else
					x--;
			}
		}
		x=0;
		int c=0;
		int max=0;
	//	System.out.println(Arrays.toString(Arr));
		for(int i=0;i<Arr.length;i++){
			if(!Arr[i]){
				x++;
				if(x>max){
					max=x;
					c=1;
				}else if(max==x)
					c++;
				
			}else{
				x=0;
			}
		}
		if(max==0)c=1;
		System.out.println(max+" "+c);
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		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();
		}

	}

}